Skip to content

Commit e51f6ff

Browse files
authored
fix(event_handler): expanding safe URI characters to include +$& (#3026)
1 parent 2cac2b5 commit e51f6ff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

aws_lambda_powertools/event_handler/api_gateway.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
logger = logging.getLogger(__name__)
4242

4343
_DYNAMIC_ROUTE_PATTERN = r"(<\w+>)"
44-
_SAFE_URI = "-._~()'!*:@,;=" # https://www.ietf.org/rfc/rfc3986.txt
44+
_SAFE_URI = "-._~()'!*:@,;=+&$" # https://www.ietf.org/rfc/rfc3986.txt
4545
# API GW/ALB decode non-safe URI chars; we must support them too
4646
_UNSAFE_URI = r"%<> \[\]{}|^"
4747
_NAMED_GROUP_BOUNDARY_PATTERN = rf"(?P\1[{_SAFE_URI}{_UNSAFE_URI}\\w]+)"

tests/functional/event_handler/test_api_gateway.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ def get_network_account(account_id: str, network_id: str):
989989
[
990990
pytest.param(123456789, id="num"),
991991
pytest.param("[email protected]", id="email"),
992-
pytest.param("-._~'!*:@,;()=", id="safe-rfc3986"),
992+
pytest.param("-._~'!*:@,;()=+&$", id="safe-rfc3986"),
993993
pytest.param("%<>[]{}|^", id="unsafe-rfc3986"),
994994
],
995995
)

0 commit comments

Comments
 (0)