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

support text/plain when json-ld mediatype is not provided #44

Open
EmidioStani opened this issue Apr 18, 2022 · 2 comments
Open

support text/plain when json-ld mediatype is not provided #44

EmidioStani opened this issue Apr 18, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@EmidioStani
Copy link

EmidioStani commented Apr 18, 2022

Hello,

I was trying to use your library by parsing a remote context on GitHub as raw file. The problem is that by using raw content, GitHub provides text/plain.

So would it possible to parse it as least text/plain when the json-ld mediatype is not provided or let the user decide which mediatype should be looking for.

Thanks,

Emidio

@rubensworks
Copy link
Owner

In the near term, you could pass a custom fetch function into the constructor, which injects the required content-type in the response header.

But I'm also open to a PR that adds a (non-default) option to pass a custom response content-type override.

@rubensworks rubensworks added the enhancement New feature or request label Apr 19, 2022
@j-steinbach
Copy link

This is also relevant when a document exposes itself as the wrong application type.

For example https://w3c.github.io/vc-di-bbs/contexts/v1/ has content-type | application/json; charset=utf-8. This in turn breaks JSON-LD documents stored on a Solid pod, or at least makes them not accessible via tools like Solid Pod Browsers such as Penny ("No permission to access this resource") or via the Firefox RDF Browser extension (Error: Failed to load remote context https://w3id.org/security/bbs/v1: Unsupported JSON-LD media type application/json).

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

No branches or pull requests

3 participants