o-development / ldo

Monorepo for Linked Data Objects (ldo)
MIT License
23 stars 5 forks source link

useResource and content-negociation #20

Closed pchampin closed 2 months ago

pchampin commented 3 months ago

useResource fails to load my WebID profile at https://champin.net/#pa, because my server returns HTML unless an RDF content-type is explicitly requested.

If useResource is primarily used to feed the underlying dataset, then it should accept RDF content-types explicitly (currently, it seems to send accept: */*.

More generally (and regardless of the point above), it would be nice if UseResourceOptions provided a way to customize (at least some) HTTP headers, so that the accept header could be customized.

jaxoncreed commented 2 months ago

You were right, the headers were not "text/turtle," this should be fixed, though I did test it on your webId, and your webId doesn't seem to return link headers, so there's still a problem. I'll check to see if the Solid spec REQUIRES link headers.

pchampin commented 2 months ago

Indeed, the accept header is now fixed, and (get/use)Resource("https://champin.net/") now gets turtle content in the response. And indeed, this then creates an error about the absent link. This calls for a new issue :sweat_smile:

jaxoncreed commented 1 month ago

You actually don't need to return link headers under the Solid spec, so that's my bad. I've removed that requirement in https://github.com/o-development/ldo/pull/44