Skip to content
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

Inconsistent mediaType/s handling #62

Open
ivan-kovatchev opened this issue Mar 11, 2022 · 1 comment
Open

Inconsistent mediaType/s handling #62

ivan-kovatchev opened this issue Mar 11, 2022 · 1 comment

Comments

@ivan-kovatchev
Copy link

The JSON-LD spec uses the following accept header:

Accept: application/ld+json;profile=http://www.w3.org/ns/json-ld#expanded

When I try to use negotiator with this accept header, I'm seeing the following behaviour:

negotiator.mediaType() is application/ld+json
negotiator.mediaType(["application/ld+json"]) is undefined

negotiator.mediaType without the parameter is correct, but negotiator.mediaType with the parameter is incorrect.

This is probably linked to the profile parameter, as adding another MIME type after that works correctly:

Accept: application/ld+json;profile=http://www.w3.org/ns/json-ld#expanded, application/n-quads
negotiator.mediaTypes() is [ 'application/ld+json', 'application/n-quads' ]
negotiator.mediaTypes(["application/n-quads"]) is [ 'application/n-quads' ]
@glasser
Copy link

glasser commented Mar 3, 2023

Duplicate of #35 , I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants