Skip to content

Content-type on HEAD is text/plain, text/turtle on GET #789

Closed

Description

@RubenVerborgh

Activity

  1. added this to the 5.0.0 milestone on Sep 23, 2018
  2. timbl commented on Sep 24, 2018

    @timbl
    Contributor

    If you open that uri in the data browser it seems to get turtle

  3. 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
  4. RubenVerborgh commented on Sep 24, 2018

    @RubenVerborgh
    ContributorAuthor

    @timbl I noticed this only happens on HEAD.

  5. akuckartz commented on Sep 24, 2018

    @akuckartz

    Another reason to create an automatic test suite...

  6. RubenVerborgh commented on Sep 24, 2018

    @RubenVerborgh
    ContributorAuthor

    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.

  7. melvincarvalho commented on Sep 24, 2018

    @melvincarvalho
    Contributor

    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.

        // Till here it must exist
        if (!includeBody) {
          debug('HEAD only')
          res.sendStatus(200)
          return next()
        }

    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?

  8. RubenVerborgh commented on Sep 24, 2018

    @RubenVerborgh
    ContributorAuthor

    Basically we should use the exact same logic, except for stream.pipe and res.send calls. And also skip contentRange.

  9. elf-pavlik commented on Sep 24, 2018

    @elf-pavlik
    Contributor

    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

  10. RubenVerborgh commented on Sep 24, 2018

    @RubenVerborgh
    ContributorAuthor

    Duplicate of #454 indeed; straightforward #662 wouldn't fix it indeed. Closing in favor of #454.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions