jshttp / content-type

Create and parse HTTP Content-Type header
MIT License
131 stars 27 forks source link

Invalid parameter format reading Amazon AVS multipart headers #9

Closed Mnark closed 8 years ago

Mnark commented 8 years ago

I am using Amazon AVS, which is returning a content type header of ":"multipart/related; boundary=------abcde123; type=application/json". The package throws a TypeError('invalid parameter format').

It appears to be the trailing "/json" which is causing the issue (manually removing it fixes the problem).

dougwilson commented 8 years ago

Hi @Mnark, that is because the / character is not a valid character that can exist in a parameter value outside of being inside quotes.

You can read more about the syntax for a Content-Type header in the specification: https://tools.ietf.org/html/rfc7231#section-3.1.1.1