multipart: more lenient content-type parsing

It's not uncommon for files to have mime types like `image/svg+xml`.
The + in there was tripping up the strictly-`@ta` parser for the content-type.

Here we change the parser to accept +, and all the other characters that the
`@t` parser accepts. This is perhaps a bit overkill, but we primarily care
about getting the parsed request to the caller. If any further validation is
required, it can happen upstream.

Fixes #5282.
This commit is contained in:
fang 2021-10-01 15:22:22 +02:00 committed by GitHub
parent 841df9cfe4
commit 51f4c83352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@
++ cut (jest 'Content-Type: ')
++ dim (jest (cat 3 '--' del))
++ nip (jest '\0d\0a')
++ nab (more fas urs:ab)
++ nab (more fas (cook (cury rap 3) (plus qit)))
++ nag (dine ;~(less ;~(plug nip dim) next))
++ nod (dine ;~(less doq next))
++ nom (dine alp)