Open dmarkow opened 2 years ago
Also saw the note that this is based on https://github.com/ssttevee/js-multipart-parser -- they actually updated their semi-colon handling to deal with quoted text too: https://github.com/ssttevee/js-multipart-parser/commit/f5e6367a37f26bccdc067a111ca80979ab8dbd84
Same issue with equals signs in a filename, since it splits on all occurrences, the filename itself gets split in the middle and causes another mismatched quotations error.
Because
parseContentDisposition
splits the parts based on semicolons, parsing any filename with a semicolon in it results in a "malformed content-disposition header: mismatched quotations" error, due to the semicolon and everything after it being omitted from the filename part.Other libraries (e.g. https://github.com/jshttp/content-disposition/blob/master/index.js) appear to use a couple sets of regular expressions instead to make sure the quoted content stays together.