snapframework / snap-core

Core type definitions (Snap monad, HTTP types, etc) and utilities for web handlers.
http://snapframework.com/
BSD 3-Clause "New" or "Revised" License
317 stars 85 forks source link

Fix parsing of non us-ascii field values in multipart/form-data #268

Closed mulderr closed 7 years ago

mulderr commented 7 years ago

pQuotedString will fail if the value contains any control characters. This causes valid, quoted UTF-8 parameters in multipart/form-data headers to be parsed as unquoted ie. double quotes are interpreted as part of the value so you get "ąę" insted of ąę in filenames etc. This is an attempted fix.

See https://github.com/snapframework/snap-core/issues/150 for discussion.

mulderr commented 7 years ago

Rebased on top of CORS changes.

BTW, I wouldn't want to step on anyone's toe with this. I'm more than happy to rebase again after #265 gets merged.

gregorycollins commented 7 years ago

Hi,

265 was merged, can you rebase and resend? Sorry latency is so long on these :(

gregorycollins commented 7 years ago

Never mind, I merged it myself

mulderr commented 7 years ago

Awesome, thanks!