-
Notifications
You must be signed in to change notification settings - Fork 429
Bug: HTTP API with router event handler fails on whitespace in path parameter #1098
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
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
I'll look into this today. |
Awesome thanks for the detailed logs and examples. Should be easy enough to make a patch for this. |
@michaelbrewer PR was already merged by @heitorlessa. I'll leave it up to you to guys to close the issue. Hope that's alright |
haha, @sthuber90 i just woke up and was catching up. Sorry about the bug and thanks for fixing it! When i originally created the handler i missed these test cases. |
No worries. Thank you for this great project and the awesome support ❤️ |
@sthuber90 thanks for the contribution. @michaelbrewer thanks for trying to shepherd this, but the project maintainers have already validated it and merged it |
This is now released under 1.25.10 version! |
Expected Behaviour
Calling
GET /pets/{name}
orGET /pets/{name}/vets
should return a successful response with status code 200 when called with "Chester Mall" or "Chester%20Mall" (without ") asname
. API Gateway will already decode encoded whitespaces as you can see in the example events.GET /pets/Fiffi
GET /pets/Fiffi/vets
GET /pets/Chester Mall
GET /pets/Chester Mall/vets
Current Behaviour
Instead of a successful response a 404 "Not Found" is returned, with response body
Code snippet
Possible Solution
Change the
_UNSAFE_URI
constant in aws_lambda_powertools/event_handler/api_gateway from:to
Steps to Reproduce
/pets/{name}
and/pets/{name}/vets
endpoint with different namesAWS Lambda Powertools for Python version
latest (layer version 16)
AWS Lambda function runtime
{"label"=>"3.9"}
Packaging format used
{"label"=>"Lambda Layers"}
Debugging logs
The text was updated successfully, but these errors were encountered: