-
Notifications
You must be signed in to change notification settings - Fork 358
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
failed to build request: http::Error(InvalidUri(InvalidFormat)) when testing from API Gateway in the AWS Console #368
Comments
Hey @ionionascu! Thanks for creating a new issue for this. Looks like the issue comes from the request body generated by the Lambda console test event, as it's returning a As far as I'm aware, API Gateway doesn't send null values for bodies, but double-checking internally first before making a PR to support null values for this field. |
Hi @nmoutschen. The sample request I put in the test comes from data received by my lambda went I did a test from the API Gateway's Test Method feature in the AWS Console. I just changed the values of some sensitive attributes. If, in the Test Method page I add the header Separate from this, to be fair, unless there is a public AWS page that explicitely says that an attribute inside the request JSON follows certain rules, then I think all options should be supported (e.g. |
Thanks for the explanations! I just realized that I misread your original message. 🤦 My apologies for this. I'll look into it. |
Hey @ionionascu ! I was able to pinpoint the issue to how the crate was trying to generate the Uri. If the host header was absent, it would try to create an Uri from a value looking like See #369 |
Hey @ionionascu ! The PR is merged now. Could you check if you're still facing that issue against the git repository directly? |
Thank you @nmoutschen. I have tested with the current master branch and I can no longer reproduce this issue, so I will close it. |
When testing from the API Gateway's test method without explicitely providing the
Host
http header, I get the errorfailed to build request: http::Error(InvalidUri(InvalidFormat))
, which I didn't use to get (maybe the test request has been changed on AWS side).This test reproduces the error on the current master branch:
In my case, the error being generated here https://github.com/awslabs/aws-lambda-rust-runtime/blob/master/lambda-http/src/request.rs#L472
The text was updated successfully, but these errors were encountered: