adamchainz / apig-wsgi

Wrap a WSGI application in an AWS Lambda handler function for running on API Gateway or an ALB.
MIT License
161 stars 21 forks source link

Treat "application/problem+json" as non binary by default #503

Open idosavion opened 2 months ago

idosavion commented 2 months ago

Tests are green locally and seems like this area has test coverage, but please let me know if you'd like me to change parameters/add more test cases

adamchainz commented 2 months ago

Where does this come from? I need an issue before a random patch.

idosavion commented 2 months ago
  1. Thanks for the quick response!
  2. I'll open up an issue and connect it to the PR if you want me to (I thought this would improve the code base, there wasn't a bug in the code)
  3. This hasn't caused an issue on our end, but we thought other users of the repository would benefit from it, as the mime-type used in connexion is application/problem+json, which is often used to convey errors in a HTTP response
adamchainz commented 2 months ago

If it hasn't caused any issues, I'd rather do nothing. Especially since it sounds like you haven't tested the change in production..?

idosavion commented 2 months ago

We effectively tested the change in production as we're propagating a list of all the defaults and application/problem+json to non_binary_content_type_prefixes when creating our lambda handler using make_lambda_handler