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

Docs: API Gateway REST, with CORS and Lambda proxy integration results in Malformed Lambda proxy response #5399

Closed
1 task done
nilsm0hr opened this issue Oct 17, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation triage Pending triage from maintainers

Comments

@nilsm0hr
Copy link

What were you searching in the docs?

Hi,
we are looking at using the CORS settings from the powertools to replace our custom handling to the headers based on the AWS docs.

Unfortunately, we get a 502 Execution failed due to configuration error: Malformed Lambda proxy response error in the API Gateway logs. The only difference that we can spot between our implementation based on the docs is that we return a header where as the powertools response adds the headers in the multiValueHeaders

Is this related to an existing documentation section?

https://docs.powertools.aws.dev/lambda/python/latest/core/event_handler/api_gateway/#cors

How can we improve?

Is there any way to clarify what is exactly required here? I am not sure if there is a special setting for the REST API Gateway that we need to enable the support of multiValueHeaders? Or would there be any other explanation for why the API Gateway runtime is rejecting the response from powertools?

Got a suggestion in mind?

No response

Acknowledgment

  • I understand the final update might be different from my proposed suggestion, or refused.
@nilsm0hr nilsm0hr added documentation Improvements or additions to documentation triage Pending triage from maintainers labels Oct 17, 2024
Copy link

boring-cyborg bot commented Oct 17, 2024

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@nilsm0hr
Copy link
Author

We have sorted this out ourselves. The docs are correct, we just had the wrong content_type in the response

@github-project-automation github-project-automation bot moved this from Triage to Coming soon in Powertools for AWS Lambda (Python) Oct 17, 2024
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation triage Pending triage from maintainers
Projects
Status: Coming soon
Development

No branches or pull requests

1 participant