You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Return correct Content-Type for JSON-LD resources (from file extension) #413
If Content-Type is derived from the file extension, return the correct mime-type in the response headers. Appears to default to text/turtle.
e.g.,
foo.jsonld returns text/turtle Content-Type
foo.json returns application/json with HTTP 501 (this is probably a separate issue)
Possibly related:
foo (in JSON-LD) returns text/turtle Content-Type
"Accept: application/ld+json" returns Error translating between RDF formats (trying to parse it as Turtle before trying serialise as JSON-LD - see also Fix serialization to jsonld #226)
I suspect that whatever library we're using to derive content type from file extensions doesn't recognize .jsonld.. We should look into it (and if there's nothing to be done there, handle it separately in the code).
changed the title [-]Return correct Content-Type for resource with extension[/-][+]Return correct Content-Type for JSON-LD resources (from file extension)[/+]on Jul 6, 2016
foo.jsonld should return application/ld+json as its Content-Type
The main culprit is that the mime npm package that node-solid-server is using to translate from a file extension to a MIME Type just doesn't recognize application/ld+json as a valid type. Try this out in your terminal:
I suspect this is because the JSON-LD MIME Type is still undergoing the IANA standardization process? I think a temporary fix for this might be adding in a hardcoded custom check to node-solid-server, to test specifically for the .jsonld extension.
Activity
dmitrizagidulin commentedon Jul 5, 2016
I suspect that whatever library we're using to derive content type from file extensions doesn't recognize
.jsonld.. We should look into it (and if there's nothing to be done there, handle it separately in the code).[-]Return correct Content-Type for resource with extension[/-][+]Return correct Content-Type for JSON-LD resources (from file extension)[/+]dmitrizagidulin commentedon Jul 19, 2016
Let's tackle these issues one at a time.
The main culprit is that the mime npm package that
node-solid-serveris using to translate from a file extension to a MIME Type just doesn't recognizeapplication/ld+jsonas a valid type. Try this out in your terminal:Same thing in the other direction:
I suspect this is because the JSON-LD MIME Type is still undergoing the IANA standardization process? I think a temporary fix for this might be adding in a hardcoded custom check to
node-solid-server, to test specifically for the.jsonldextension.csarven commentedon Jul 20, 2016
https://www.iana.org/assignments/media-types/application/ld+json is standardised as it gets?
dmitrizagidulin commentedon Jul 20, 2016
@csarven aha! Excellent. Let's file an issue on the
mimenpm package, to add it?melvincarvalho commentedon Jul 20, 2016
FYI: A few sources:
http://www.iana.org/assignments/media-types/media-types.xhtml
http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
http://hg.nginx.org/nginx/raw-file/default/conf/mime.types
These are aggregated here:
https://github.com/jshttp/mime-db
Github uses this, for example.
dmitrizagidulin commentedon Jul 21, 2016
Can somebody open an issue on mime-db, or make a PR for jsonld?
melvincarvalho commentedon Jul 21, 2016
JSON-LD is supported by mime-db, isnt it? What would the pull request be for?
dmitrizagidulin commentedon Jul 21, 2016
@melvincarvalho oh, whoops, yeah. I was hoping the
mimenpm package drew from that, but looks like it doesnt.dmitrizagidulin commentedon Nov 22, 2016
This has been fixed in PR #430. Closing.