Skip to content
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

Fixed issue with not handling query string encoding #451

Merged
merged 2 commits into from
Apr 29, 2019

Conversation

normj
Copy link
Member

@normj normj commented Apr 27, 2019

This fixed an issue where query string values were not correctly being encoded for requests coming in from API Gateway to ASP.NET Core Lambda functions. This address the following issue #415

This behavior was triggered when Application Load Balancer support was added. API Gateway will decode the values before passing them to the Lambda function and ALB does not decode. There was a mistake when ALB was added thinking both services send decoded values.

The fix is to have API Gateway request UrlEncode values before adding them to the ASP.NET Core request. ASP.NET Core will later UrlDecode the values.

Tests were done by first manually verifying what API Gateway and ALB pass into Lambda functions and then updating the encoding JSON test documents for the unit tests.

…ng from API Gateway to ASP.NET Core Lambda function
Copy link
Contributor

@vellozzi vellozzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right?
"API Gateway will encode the values before passing them to the Lambda function and ALB does not. There was a mistake when ALB was added thinking both services send decoded values."
I'm assuming it should read "API Gateway will decode the values..." instead. Otherwise, the code is opposite of the description.

Also, there's a typo in the name of Libraries/test/Amazon.Lambda.AspNetCoreServer.Test/values-get-querystring-apigatway-encoding-request.json.

@normj
Copy link
Member Author

normj commented Apr 29, 2019

Corrected description of the problem and fixed the typo in all of the test files.

@normj normj merged commit 9feb6a6 into dev Apr 29, 2019
@normj normj deleted the querystring-encoding-issue branch April 29, 2019 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants