Skip to content

Commit

Permalink
MIME Sniffing: add tests for invalid name handling
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed Jan 28, 2022
1 parent 2a64dae commit edcfc6b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mimesniff/mime-types/resources/mime-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,20 @@
"input": "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
"output": "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
},
"Invalid names",
{
"input": "text/html;a]=bar;b[=bar;c=bar",
"output": "text/html;c=bar"
},
"Semicolons in value",
{
"input": "text/html;valid=\";\";foo=bar",
"output": "text/html;valid=\";\";foo=bar"
},
{
"input": "text/html;in]valid=\";asd=foo\";foo=bar",
"output": "text/html;foo=bar"
},
"Valid",
{
"input": "!#$%&'*+-.^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/!#$%&'*+-.^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz;!#$%&'*+-.^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=!#$%&'*+-.^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
Expand Down

0 comments on commit edcfc6b

Please sign in to comment.