Skip to content

Fix malformed value parsing for Content-Type#7309

Merged
nateprewitt merged 1 commit intopsf:mainfrom
nateprewitt:parse_content_type_header_fix
Mar 30, 2026
Merged

Fix malformed value parsing for Content-Type#7309
nateprewitt merged 1 commit intopsf:mainfrom
nateprewitt:parse_content_type_header_fix

Conversation

@nateprewitt
Copy link
Copy Markdown
Member

This PR addresses #6646 by cleaning up _parse_content_type_header. Instead of setting a default that we can't use in practice, we now skip value assignment completely if the value is malformed. Every RFC from 1521 to 9110 is clear that an = is required for a valid parameter. If it doesn't exist, we need to ignore it.

@nateprewitt nateprewitt merged commit f0198e6 into psf:main Mar 30, 2026
26 checks passed
@nateprewitt nateprewitt deleted the parse_content_type_header_fix branch March 30, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant