Skip to content

Incorrect HTTP Response Headers for "Accept: text/turtle" #632

Closed

Description

@kidehen

curl -ILH "Accept: text/turtle" https://kidehen.solidtest.space:8443/profile/card#me

HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Wed, 07 Feb 2018 21:47:06 GMT
**Content-Type: text/plain; charset=utf-8**
Content-Length: 2
Connection: keep-alive
X-Powered-By: solid-server
Vary: Origin
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: Authorization, User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Accept-Post, Updates-Via, Allow, WAC-Allow, Content-Length, WWW-Authenticate
Allow: OPTIONS, HEAD, GET, PATCH, POST, PUT, DELETE
Link: <card.acl>; rel="acl", <card.meta>; rel="describedBy", <http://www.w3.org/ns/ldp#Resource>; rel="type"
WAC-Allow: user="read",public="read"
MS-Author-Via: SPARQL
Updates-Via: wss://kidehen.solidtest.space
ETag: W/"2-nOO9QiTIwXgNtWtBJezz8kv3SLc"
Strict-Transport-Security: max-age=15768000

Content-Type: text/plain; charset=utf-8 is wrong, bearing in mind what's in the actual HTTP Request

Bearing in mind:
curl -i "Accept: text/turtle" https://kidehen.solidtest.space:8443/profile/card#me
curl: (3) Illegal port number
HTTP/1.1 200 OK
X-Powered-By: solid-server
Vary: Origin
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: Authorization, User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Accept-Post, Updates-Via, Allow, WAC-Allow, Content-Length, WWW-Authenticate
Allow: OPTIONS, HEAD, GET, PATCH, POST, PUT, DELETE
Link: <card.acl>; rel="acl", <card.meta>; rel="describedBy", http://www.w3.org/ns/ldp#Resource; rel="type"
WAC-Allow: user="read",public="read"
MS-Author-Via: SPARQL
Updates-Via: wss://kidehen.solidtest.space:8443
Content-Type: text/turtle
Date: Tue, 13 Mar 2018 20:55:00 GMT
Connection: keep-alive
Transfer-Encoding: chunked

Re

@prefix solid: <http://www.w3.org/ns/solid/terms#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix pim: <http://www.w3.org/ns/pim/space#>.
@prefix schema: <http://schema.org/>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.

<>
    a foaf:PersonalProfileDocument ;
    foaf:maker <http://id.myopenlink.net/public_home/KingsleyUyiIdehen/Public/kingsley.ttl#this> ;
    foaf:primaryTopic <http://id.myopenlink.net/public_home/KingsleyUyiIdehen/Public/kingsley.ttl#this> .

<http://id.myopenlink.net/public_home/KingsleyUyiIdehen/Public/kingsley.ttl#this>
    a foaf:Person ;
    a schema:Person ;

    foaf:name "Kingsley Idehen" ;

    solid:account </> ;  # link to the account uri
    pim:storage </> ;    # root storage

    ldp:inbox </inbox/> ;

    pim:preferencesFile </settings/prefs.ttl> ;  # private settings/preferences
    solid:publicTypeIndex </settings/publicTypeIndex.ttl> ;
    solid:privateTypeIndex </settings/privateTypeIndex.ttl> .

Activity

  1. melvincarvalho commented on Feb 7, 2018

    @melvincarvalho
    Contributor

    @kidehen thanks for raising this!

    GET seems to work, but not HEAD

    seeAlso chatlog

  2. melvincarvalho commented on Feb 7, 2018

    @melvincarvalho
    Contributor
  3. melvincarvalho commented on Feb 7, 2018

    @melvincarvalho
    Contributor
        // If request accepts the content-type we found
        if (negotiator.mediaType([contentType])) {
          res.setHeader('Content-Type', contentType)
        }

    This bit may need to come before the return next()

  4. melvincarvalho commented on Feb 8, 2018

    @melvincarvalho
    Contributor

    Light testing shows that this patch is likely to fix the issue

        // Till here it must exist
        if (!includeBody) {
          // If request accepts the content-type we found
          if (negotiator.mediaType([contentType])) {
            res.setHeader('Content-Type', contentType)
          }
          debug('HEAD only')
          res.sendStatus(200)
          return next()
        }
  5. timbl commented on Mar 8, 2018

    @timbl
    Contributor

    An issue with etag being not the same for head and get is discussed in gitter solid/node-solid-server at March 8, 2018 1:08 PM ... In this case, Etags work on HEAD but under some circumstances not GET

  6. RubenVerborgh commented on Mar 8, 2018

    @RubenVerborgh
    Contributor

    The content-type issues will likely be solved once #643 is incorporated.

  7. RubenVerborgh commented on Jul 19, 2018

    @RubenVerborgh
    Contributor

    Will be fixed by #662.

  8. RubenVerborgh commented on Sep 24, 2018

    @RubenVerborgh
    Contributor

    Duplicate of #454, following up there.

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions