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

Creating a resource with multiple Content-Types #685

Closed
fuubi opened this issue Apr 6, 2021 · 3 comments
Closed

Creating a resource with multiple Content-Types #685

fuubi opened this issue Apr 6, 2021 · 3 comments
Labels
wontfix This will not be worked on

Comments

@fuubi
Copy link

fuubi commented Apr 6, 2021

The server only keeps the latest version when creating multiple resources with the same URL but with different Content-Type Headers.

$ curl -X PUT -H "Content-Type: text/turtle"   -d "<ex:s> <ex:p> <ex:o>."   http://localhost:3000/test

$ ls data/
'test$.ttl'

$ curl -X PUT -H "Content-Type: text/plain"   -d "hey"   http://localhost:3000/test

$ ls data/
'test$.txt'

$ curl -X PUT -H "Content-Type: text/plain"   -d "hey"   http://localhost:3000/test.txt

$ ls data/
'test$.txt'   test.txt

I am also interested in understanding why the server stores the resources with the $.* suffix. Shouldn't the resource with the file extension be the same as the one defined by a URL missing the extension but including the Content-Type? Is this behaviour defined by HTTP and meant to be handled by the application developer?

@fuubi fuubi changed the title Creating resources with multiple Content-Types Creating a resource with multiple Content-Types Apr 6, 2021
@csarven
Copy link

csarven commented Apr 6, 2021

The server responses looks right to me.
PUT is replacing resource state. Server doesn't need to retain representations of prior states.
$.* is part of a server-controlled suffix (implementation detail). It is not part of the URI.
test and test.txt are URIs of different resources. Server is not exposing the local name (whether that's 'test$.txt' or test.txt) - that's why PUT to test.txt is a different resource than test (which happens to be test$.txt on disk)

@fuubi
Copy link
Author

fuubi commented Apr 6, 2021

I see. I forgot that the resources are identified by URIs. Then it makes sense that test and test.txt identify two different resources.

I might not remember it correctly, but I think NSS kept track of multiple representations of a resource. As I used to add a Turtle and a HTML representation for resources with the same URI (ex. ./public/{index$.html,index$.ttl}).

@RubenVerborgh RubenVerborgh added the wontfix This will not be worked on label Apr 7, 2021
@RubenVerborgh
Copy link
Member

RubenVerborgh commented Apr 7, 2021

I might not remember it correctly, but I think NSS kept track of multiple representations of a resource.

It did, but that was a mistake. See solid/specification#198 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants