Docs: In the SAM template, BinaryMediaTypes and CORS do not work together

What were you searching in the docs?

How to configure CORS

Is this related to an existing documentation section?

https://docs.powertools.aws.dev/lambda/python/latest/core/event_handler/api_gateway/#required-resources

How can we improve?

If I'm not wrong, when configuring CORS in the template.yml of AWS SAM, CORS doesn't work if BinaryMediaTypes is set. See this issue.

The example in the documentation has both CORS and BinaryMediaTypes configured. I just copied this example without thinking much and I was surprised to see that it doesn't work. I think that at least a note should be added somewhere to indicate that these two are incompatible.

Got a suggestion in mind?

No response

Acknowledgment

  • I understand the final update might be different from my proposed suggestion, or refused.