-
Notifications
You must be signed in to change notification settings - Fork 432
Bug: APIGatewayRestResolver does not capture path segment with + sign #3006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looking at this now. |
Hello @nejcskofic! I can confirm that this is indeed a bug and we need to fix it. Our Resolver must be able to handle these additional characters: Do you want to submit a fix + tests for this issue? We plan to launch a release on Friday and we'd love it if you would send in a PR to contribute to Powertools for AWS Lambda. Don't worry if you can't, We know everyone's been very busy and I can fix that. |
Hello @leandrodamascena. Thanks for the response. I can take a look at it later today. One question though: in your response you mention only |
Sorry, I made a mistake! Yes, include Thanks and let me know if you need any help. |
|
Expected Behaviour
If handler is registered for dynamic path, I would expect that segment containing plus sign is captured.
Example:
Resolver is invoked with:
GET /dummy/a+b
Current Behaviour
Resolver returns 404 error.
Code snippet
Possible Solution
api_gateway.pyL44 contains definition of safe characters. This list is incomplete. By rfc3986 Section 3.3 path is built from segments where segments can contain
sub-delims
which are defined as:API Gateway resolver is using this list of characters when building route regex:
Plus sign (
+
), dollar sign ($
) and ampersand sign (&
) are missing from that list. Adding them would resolve this issue.Steps to Reproduce
Run above code snippet as pytest test.
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.10
Packaging format used
PyPi
Debugging logs
No response
The text was updated successfully, but these errors were encountered: