Fix parsing of content-type header

Fixes #2216

This was broken when we switched from media-typer to content-type
modules for parsing the content-type header.

The content-type header can handle the field with parameters, but
does not do the type/sub-type parsing that media-typer does.

Our code relied on that extra bit of parsing to correctly
identify if the content should be parsed to String or kept as
a buffer.

The fix restores the use of media-typer, but using the result
of the content-type module to make sure it valid
This commit is contained in:
Nick O'Leary
2019-06-20 21:15:20 +01:00
parent f3fc083330
commit e315325d91
3 changed files with 19 additions and 12 deletions

View File

@@ -30,6 +30,7 @@
"https-proxy-agent": "2.2.1",
"is-utf8": "0.2.1",
"js-yaml": "3.13.1",
"media-typer": "1.1.0",
"mqtt": "2.18.8",
"multer": "1.4.1",
"mustache": "3.0.1",