jshttp / content-type

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

double quotes seemingly required for profile parameter #2

Closed howarddierking closed 9 years ago

howarddierking commented 9 years ago

I'm using content-type to extract the profile parameter. According to the spec, the URI may be enclosed in either single or double quotes (or not at all). However, the current version is throwing an error in all cases except for double quotes.

howarddierking commented 9 years ago

interestingly, Express' JSON body parser has the same hangup (e.g. it's unable to identify the content-type as JSON if the URI in the profile parameter is not enclosed in double quotes). Wondering whether I just missed the memo...

dougwilson commented 9 years ago

A MIME type is not the same as a Content-Type header. You MUST use double quotes when putting certain characters in the value that are disallowed in HTTP (like a colon).

howarddierking commented 9 years ago

ahh - I think I see in looking more at that spec - it was pertaining more to extending a couple registered media types - thanks for the clarification

dougwilson commented 9 years ago

Np. Even though this is closed, I watch everything so feel free to ask any follow up questions here :) And sorry for the brevity in the initial response, I'm on the cell and want to get you some quick answer :)