Skip to content

Commit db20c9b

Browse files
committed
fix(apigw): add all safe URI chars RFC3986 pt2
1 parent 9e58198 commit db20c9b

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
@@ -22,7 +22,7 @@
2222

2323
_DYNAMIC_ROUTE_PATTERN = r"(<\w+>)"
2424
# Safe URI chars https://www.ietf.org/rfc/rfc3986.txt
25-
_NAMED_GROUP_BOUNDARY_PATTERN = r"(?P\1[-._~()'!*:@,;\\w]+)"
25+
_NAMED_GROUP_BOUNDARY_PATTERN = r"(?P\1[-._~()'!*:@%#,;\\w]+)"
2626

2727

2828
class ProxyEventType(Enum):

tests/functional/event_handler/test_api_gateway.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ def get_network_account(account_id: str, network_id: str):
703703
app.resolve(event, {})
704704

705705

706-
@pytest.mark.parametrize("req", [123456789, "user@example.com", "<foo>", "-._~'!*:@,;"])
706+
@pytest.mark.parametrize("req", [123456789, "user@example.com", "-._~'!*:@,;%#"])
707707
def test_non_word_chars_route(req):
708708
# GIVEN
709709
app = ApiGatewayResolver()

0 commit comments

Comments
 (0)