-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Content type with profile not matching as expected #44
Comments
This is because what you provided as the |
There is an open issue #14 to support parameters in the |
Ah thanks. I'm just trying to implement this W3 spec. I'm sure It will work fine without specifying the profile in my types list |
Gotcha, makes sense. So yes, this library doesn't let you match on the parameters. The only way you can do it currently is to include the var contentType = require('content-type')
var typeis = require('type-is')
// ... later on
if (typeis(req, 'application/ld+json') && contentType.parse(req).parameters.profile === 'https://www.w3.org/ns/activitystreams') {
// accepts that specific thing
} |
Version 1.6.18
typeIs.is('application/ld+json; profile="https://www.w3.org/ns/activitystreams"', ['application/ld+json; profile="https://www.w3.org/ns/activitystreams"'])
Evaluates to
false
. It seems to use different normalization methods for value and typeThe text was updated successfully, but these errors were encountered: