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

fix(event-handler): body to empty string in CORS preflight (ALB non-compliant) #1249

Merged

Conversation

heitorlessa
Copy link
Contributor

@heitorlessa heitorlessa commented Jun 16, 2022

Issue number: #1248

Summary

Changes

Please provide a summary of what's being changed

ALB doesn't follow HTTP CORS Spec and returns 502 when a body response is null. This PR returns an empty string to make it compliant.

User experience

Please share what the user experience looks like before and after this change

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 16, 2022
@github-actions github-actions bot added the bug Something isn't working label Jun 16, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2022

Codecov Report

Merging #1249 (e545793) into develop (2302099) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #1249   +/-   ##
========================================
  Coverage    99.88%   99.88%           
========================================
  Files          119      119           
  Lines         5423     5423           
  Branches       618      618           
========================================
  Hits          5417     5417           
  Misses           2        2           
  Partials         4        4           
Impacted Files Coverage Δ
aws_lambda_powertools/event_handler/api_gateway.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2bd8722...e545793. Read the comment docs.

@heitorlessa heitorlessa changed the title fix(event-handler): ALB requires empty body but null for CORS preflight fix(event-handler): body to empty string in CORS preflight (ALB non-compliant) Jun 16, 2022
@heitorlessa heitorlessa merged commit d1b8e83 into aws-powertools:develop Jun 16, 2022
@heitorlessa heitorlessa deleted the fix/event-handler-alb-cors branch June 16, 2022 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants