Repository navigation
Validate declared MIME types - #160
Merged
jeremy merged 1 commit intoAug 19, 2026
Merged
Conversation
jeremy
force-pushed
the
security/strict-declared-type
branch
from
August 18, 2026 09:36
14c84c4 to
a78be60
Compare
jeremy
force-pushed
the
security/strict-declared-type
branch
from
August 18, 2026 09:37
a78be60 to
ba0e17c
Compare
jeremy
force-pushed
the
security/strict-declared-type
branch
from
August 18, 2026 09:40
ba0e17c to
5f02592
Compare
Accept one well-formed media type with optional parameters, ignore malformed or oversized values, and preserve the common trailing-semicolon form. Invalid values fall back to the other detection inputs.
jeremy
force-pushed
the
security/strict-declared-type
branch
from
August 18, 2026 18:28
5f02592 to
3ae4fd1
Compare
This was referenced Aug 20, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #159.
Declared types now accept one well-formed media type with optional parameters. Malformed values, comma-separated lists, invalid encodings, and values larger than 8 KiB are ignored so detection can continue with the other inputs.
A single trailing semicolon remains accepted for compatibility. A valid but unregistered media type is still returned by design.
Local validation:
bundle exec ruby -Itest test/declared_type_test.rb.