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

Checking media type breaks sources #54

Open
pietercolpaert opened this issue Feb 24, 2014 · 2 comments
Open

Checking media type breaks sources #54

pietercolpaert opened this issue Feb 24, 2014 · 2 comments

Comments

@pietercolpaert
Copy link

https://github.com/lanthaler/JsonLD/blob/master/FileGetContentsLoader.php#L112

This line is breaking support for for instance loading json-ld files from raw github URLs, which return a mime-type text/plain.

Do we want to throw an error if text/plan has been set? I would be in favour of also accepting it as valid.

@lanthaler
Copy link
Owner

First of all, sorry for the delay.

The JSON-LD API specification requires to check the media types (http://www.w3.org/TR/json-ld-api/#widl-JsonLdProcessor-compact-Promise-any-input-JsonLdContext-context-JsonLdOptions-options) so we can’t simply ignore them by default as that would mean we would lose spec-conformance. We could, however, add a flag or something to turn this off optionally. Would that work for you? It would probably mean that you'd pass a specific options parameter to each method you call.

@pietercolpaert
Copy link
Author

Fair enough. It would work!

Looking forward to meet you in Amsterdam next week btw!

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

No branches or pull requests

2 participants