-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not throw on some incorrect headers #25
Comments
Idk the details, but content-type and media-typer are not interchangeable, as they are for different standard. Just make sure you are using the one appropriate for whatever you are trying to parse. |
Taking a quick glance at the link, it is probably because a valid content-type header doesn't mean the type itself is a valid media type. The content-type standard is pretty open and lax vs what is a media type. The media-typer module can be used to validate media types from a content-type header if you want to check is something from the content-type header is a valid media type. |
Yep, that was what keyed me to this in the first place, I was trying to figure out why that package was being used on the
Ah, right, that makes sense. So I guess maybe I could use some advice on how to address this then. The new major of
Seems like a case could be made this is a bad test? |
You almost certainly neeed to use both modules. One to parse the content-type header and the other to validate it is a valid media type. |
Like this: jshttp/type-is@f1bc60a |
WOAH! Where is that commit? |
|
Ok, I am rebasing develop and merging it into 2.x now. Thanks for the pointer, this is exactly what I needed. |
ok, that resolved it! Thank you so much for the help! |
No problem:) I guess yay past me for helping with a commit |
jshttp/type-is#57
When updating
type-is
to use this package frommedia-typer
we no longer throw on this incorrect header pattern. I am not able to debug this morning but wanted to file this to track it.cc @dougwilson I dm'd you on slack about this but figured I could just do it here so the stuff doesn't get lost.
The text was updated successfully, but these errors were encountered: