From 58f08a9c9a258cb73090c88a9d4201b1b2a0de7d Mon Sep 17 00:00:00 2001 From: Piotr Grzesik Date: Mon, 9 Oct 2023 00:03:25 +0200 Subject: [PATCH 1/5] docs(event_handler): Highlight case-insensitive lookup of headers --- docs/core/event_handler/api_gateway.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/event_handler/api_gateway.md b/docs/core/event_handler/api_gateway.md index 4e4e935f699..3ef7cc8d7a1 100644 --- a/docs/core/event_handler/api_gateway.md +++ b/docs/core/event_handler/api_gateway.md @@ -227,7 +227,7 @@ You can access the raw payload via `body` property, or if it's a JSON string you #### Headers -Similarly to [Query strings](#query-strings-and-payload), you can access headers as dictionary via `app.current_event.headers`, or by name via `get_header_value`. +Similarly to [Query strings](#query-strings-and-payload), you can access headers as dictionary via `app.current_event.headers`, or by name via `get_header_value`. If you'd like to perform a case-insensitive lookup of the header value, the `get_header_value` utility function will do it by default. ```python hl_lines="19" title="Accessing HTTP Headers" --8<-- "examples/event_handler_rest/src/accessing_request_details_headers.py" From 3af19fdd61b0195cbf4c60a7e3d32c92d4fe53d2 Mon Sep 17 00:00:00 2001 From: Piotr Grzesik Date: Tue, 10 Oct 2023 22:57:32 +0200 Subject: [PATCH 2/5] Update docs/core/event_handler/api_gateway.md Co-authored-by: Leandro Damascena Signed-off-by: Piotr Grzesik --- docs/core/event_handler/api_gateway.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/event_handler/api_gateway.md b/docs/core/event_handler/api_gateway.md index c3503dd3d5a..c7a50500320 100644 --- a/docs/core/event_handler/api_gateway.md +++ b/docs/core/event_handler/api_gateway.md @@ -239,7 +239,7 @@ You can access the raw payload via `body` property, or if it's a JSON string you #### Headers -Similarly to [Query strings](#query-strings-and-payload), you can access headers as dictionary via `app.current_event.headers`, or by name via `get_header_value`. If you'd like to perform a case-insensitive lookup of the header value, the `get_header_value` utility function will do it by default. +Similarly to [Query strings](#query-strings-and-payload), you can access headers as dictionary via `app.current_event.headers`, or by name via `get_header_value`. If you prefer a case-insensitive lookup of the header value, the get_header_value utility function automatically handles it. ```python hl_lines="19" title="Accessing HTTP Headers" --8<-- "examples/event_handler_rest/src/accessing_request_details_headers.py" From a49c3ac028b3d8fb16ecf2e5f280c1f0c9b21951 Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Tue, 10 Oct 2023 22:38:27 +0100 Subject: [PATCH 3/5] Adding highlight --- docs/core/event_handler/api_gateway.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/event_handler/api_gateway.md b/docs/core/event_handler/api_gateway.md index c7a50500320..53e31457dbc 100644 --- a/docs/core/event_handler/api_gateway.md +++ b/docs/core/event_handler/api_gateway.md @@ -239,7 +239,7 @@ You can access the raw payload via `body` property, or if it's a JSON string you #### Headers -Similarly to [Query strings](#query-strings-and-payload), you can access headers as dictionary via `app.current_event.headers`, or by name via `get_header_value`. If you prefer a case-insensitive lookup of the header value, the get_header_value utility function automatically handles it. +Similarly to [Query strings](#query-strings-and-payload), you can access headers as dictionary via `app.current_event.headers`, or by name via `get_header_value`. If you prefer a case-insensitive lookup of the header value, the `get_header_value` utility function automatically handles it. ```python hl_lines="19" title="Accessing HTTP Headers" --8<-- "examples/event_handler_rest/src/accessing_request_details_headers.py" From 51481dca38197ef67ae1372d8fe7738e7c6ddf62 Mon Sep 17 00:00:00 2001 From: Heitor Lessa Date: Wed, 11 Oct 2023 10:11:27 +0200 Subject: [PATCH 4/5] docs: typo in function Signed-off-by: Heitor Lessa --- docs/core/event_handler/api_gateway.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/event_handler/api_gateway.md b/docs/core/event_handler/api_gateway.md index 53e31457dbc..5ae15a9df2e 100644 --- a/docs/core/event_handler/api_gateway.md +++ b/docs/core/event_handler/api_gateway.md @@ -239,7 +239,7 @@ You can access the raw payload via `body` property, or if it's a JSON string you #### Headers -Similarly to [Query strings](#query-strings-and-payload), you can access headers as dictionary via `app.current_event.headers`, or by name via `get_header_value`. If you prefer a case-insensitive lookup of the header value, the `get_header_value` utility function automatically handles it. +Similarly to [Query strings](#query-strings-and-payload), you can access headers as dictionary via `app.current_event.headers`, or by name via `get_header_value`. If you prefer a case-insensitive lookup of the header value, the `app.current_event.get_header_value` function automatically handles it. ```python hl_lines="19" title="Accessing HTTP Headers" --8<-- "examples/event_handler_rest/src/accessing_request_details_headers.py" From 933d3d9c721f6d6d20064eb53100d1780cc6883a Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Wed, 11 Oct 2023 11:18:40 +0100 Subject: [PATCH 5/5] Heitor's feedback --- aws_lambda_powertools/utilities/data_classes/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws_lambda_powertools/utilities/data_classes/common.py b/aws_lambda_powertools/utilities/data_classes/common.py index fa7c5296042..28229c21a62 100644 --- a/aws_lambda_powertools/utilities/data_classes/common.py +++ b/aws_lambda_powertools/utilities/data_classes/common.py @@ -189,7 +189,7 @@ def get_header_value( default_value: str, optional Default value if no value was found by name case_sensitive: bool - Whether to use a case-sensitive look up + Whether to use a case-sensitive look up. By default we make a case-insensitive lookup. Returns ------- str, optional