Skip to content

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

@nilsm0hr

Description

@nilsm0hr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationtriagePending triage from maintainers

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions