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
Content-type on HEAD is text/plain, text/turtle on GET #789
changed the title [-]Content-type of index file suddenly changed to text/plain[/-][+]Content-type on HEAD is text/plain, text/turtle on GET[/+]on Sep 24, 2018
And another reason to rethink the architecture 😄
The fact that it works for GET but not for HEAD shows that they have different logic paths, which should not be the case.
While we can fix this bug by fixing the HEAD implementation, the actual issue is deeper.
Activity
timbl commentedon Sep 24, 2018
If you open that uri in the data browser it seems to get turtle
[-]Content-type of index file suddenly changed to text/plain[/-][+]Content-type on HEAD is text/plain, text/turtle on GET[/+]RubenVerborgh commentedon Sep 24, 2018
@timbl I noticed this only happens on HEAD.
akuckartz commentedon Sep 24, 2018
Another reason to create an automatic test suite...
RubenVerborgh commentedon Sep 24, 2018
And another reason to rethink the architecture 😄
The fact that it works for GET but not for HEAD shows that they have different logic paths, which should not be the case.
While we can fix this bug by fixing the HEAD implementation, the actual issue is deeper.
melvincarvalho commentedon Sep 24, 2018
Good insight! I think the code is here
https://github.com/solid/node-solid-server/blob/master/lib/handlers/get.js#L76
Basically the get and head handlers are the same file because head is just a get without a body.
What happens is there is an !includeBody flag which is set on either GET or HEAD.
Possibly the mime type logic needs to occur before that. Maybe we would benefit from a test to catch it too.
Does this touch any other parts of code?
RubenVerborgh commentedon Sep 24, 2018
Basically we should use the exact same logic, except for
stream.pipeandres.sendcalls. And also skipcontentRange.elf-pavlik commentedon Sep 24, 2018
I reported similar issue 2 years ago #454 In most recent comment there you suggest that #662 might fix that.
Also same issue raised in #632
RubenVerborgh commentedon Sep 24, 2018
Duplicate of #454 indeed; straightforward #662 wouldn't fix it indeed. Closing in favor of #454.