Skip to content

Commit

Permalink
🩹 Add vnd.oai.openapi to mime type list that are not base64 encoded (K…
Browse files Browse the repository at this point in the history
  • Loading branch information
khamaileon committed Jan 13, 2024
1 parent 54a575d commit 9c5f613
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion docs/adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ handler = Mangum(
app,
lifespan="auto",
api_gateway_base_path=None,
text_mime_types=None,
)
```

Expand Down
5 changes: 2 additions & 3 deletions docs/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ Binary responses are determined using the `Content-Type` and `Content-Encoding`

### Text MIME types

By default, all response data will be [base64 encoded](https://docs.python.org/3/library/base64.html#base64.b64encode) and include `isBase64Encoded=True` in the response ***except*** the default text MIME types and any MIME types included in the `TEXT_MIME_TYPES` list setting.

The following types are excluded from binary responses by default:
By default, all response data will be [base64 encoded](https://docs.python.org/3/library/base64.html#base64.b64encode) and include `isBase64Encoded=True` in the response ***except*** the following MIME types:

- `application/json`
- `application/javascript`
- `application/xml`
- `application/vnd.api+json`
- `application/vnd.oai.openapi`

Additionally, any `Content-Type` header prefixed with `text/` is automatically excluded.

Expand Down
1 change: 1 addition & 0 deletions mangum/handlers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"application/javascript",
"application/xml",
"application/vnd.api+json",
"application/vnd.oai.openapi",
]


Expand Down

0 comments on commit 9c5f613

Please sign in to comment.