Skip to content

Default Content-Type with malformed header #10889

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

Open
Dreamsorcerer opened this issue May 19, 2025 · 0 comments
Open

Default Content-Type with malformed header #10889

Dreamsorcerer opened this issue May 19, 2025 · 0 comments
Labels
Milestone

Comments

@Dreamsorcerer
Copy link
Member

Dreamsorcerer commented May 19, 2025

We're using email.parser.HeaderParser to parse our headers, which uses some behaviour defined in email-specific draft RFCs.
As a result, the behaviour when the Content-Type is malformed is to set it to text/plain, which doesn't really make sense (and may break things) in a general HTTP application.

Ideally, we should consider replacing this so that it defaults to application/octet-stream (or maybe None?):
https://www.rfc-editor.org/rfc/rfc9110#section-8.3-5

@Dreamsorcerer Dreamsorcerer added this to the 4.0 milestone May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant