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
To reproduce (first make sure a Solid directory is public-appendable, so that you don't get a 403 Unauthorized):
curl -vk -XPOST https://localhost:8443/profile/ -H 'Slug: movies/'< HTTP/1.1 409 Conflict
# And on the LDnode side:
ldnode:handlers POST -- On parent: /profile/ +0ms
ldnode:handlers POST -- Will create at: /profile/movies/ +1ms
ldnode:server Error page because of PUT not supported on containers, use POST instead +0ms
ldnode:post File stored in /profile/movies/ +14ms
_http_outgoing.js:346
throw new Error('Can\'t set headers after they are sent.'); ^Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:346:11)
at ServerResponse.header (/Users/dmitri/code/_Solid/ldnode/node_modules/express/lib/response.js:718:10)
at /Users/dmitri/code/_Solid/ldnode/lib/handlers/post.js:92:13
at /Users/dmitri/code/_Solid/ldnode/lib/ldp.js:348:7
at LDP.put (/Users/dmitri/code/_Solid/ldnode/lib/ldp.js:360:12)
at /Users/dmitri/code/_Solid/ldnode/lib/ldp.js:345:9
at /Users/dmitri/code/_Solid/ldnode/lib/ldp.js:520:7
at /Users/dmitri/code/_Solid/ldnode/node_modules/async/lib/async.js:789:30
at /Users/dmitri/code/_Solid/ldnode/node_modules/async/lib/async.js:167:37
at /Users/dmitri/code/_Solid/ldnode/lib/ldp.js:513:9
Incidentally, note the line ldnode:server Error page because of PUT not supported on containers, use POST instead +0ms -- that shouldn't be happening, since this is a POST.
This is probably happening because the line doesn't include the appropriate -H 'Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"' header (meaning, this is a plain resource).
Anyways, should probably be fixed :)
Yes, always drop the slash. You should never have a slash in the slug, since the value of this header should be the name of the resource, not a path! I think doing something along the lines of .replace('/', '') should fix it.
Activity
nicola commentedon Mar 31, 2016
I think it must be because you have
/in the slug, will check soon (sorry I did not read the title)nicola commentedon Mar 31, 2016
@deiu @dmitrizagidulin what should the default behavior be?
I think:
deiu commentedon Mar 31, 2016
Yes, always drop the slash. You should never have a slash in the slug, since the value of this header should be the name of the resource, not a path! I think doing something along the lines of
.replace('/', '')should fix it.nicola commentedon Mar 31, 2016
or maybe replace it with a urlencoded string if it is in the middle
dmitrizagidulin commentedon Mar 31, 2016
+1 to dropping the slash. (though I'm fine with bad request error too)
nicola commentedon Apr 6, 2016
fixed in #311