Repository: nodeSolidServer/node-solid-server

Issue #454: HEAD doesn't set right Content-Type  or right Content-Length headers
Created: 2016-10-26T23:17:46Z
for example GET request to foo.png includes correct header
Content-Type: image/png
but HEAD request to foo.png responds with incorrect header
Content-Type: text/plain; charset=utf-8

Duplicate issue #1417: Inconsistent Headers between HEAD and GET on containers at least! In particular, inconsistent 'content-type'
Created: 2020-04-07T20:21:44Z
I am not sure where to file this bug but since inrupt.net uses NSS, I am presuming this would be the logical place!
The header in response to HEAD to a container is like this:
{
   {
    'x-powered-by': [ 'solid-server/5.2.3' ],
    vary: [ 'Accept, Authorization, 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, MS-Author-Via'
    ],
    allow: [ 'OPTIONS, HEAD, GET, PATCH, POST, PUT, DELETE' ],
    link: [
      '<.acl>; rel="acl", <.meta>; rel="describedBy", <http://www.w3.org/ns/ldp#Container>; rel="type", <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"'
    ],
    'wac-allow': [ 'user="read write append control",public="read"' ],
    'ms-author-via': [ 'SPARQL' ],
    'updates-via': [ 'wss://cxres.inrupt.net' ],
    'content-type': [ 'application/octet-stream; charset=utf-8' ],
    'content-length': [ '2' ],
    etag: [ 'W/"2-nOO9QiTIwXgNtWtBJezz8kv3SLc"' ],
    'set-cookie': [
      'nssidp.sid=s%3A58cbIKn7xKh-xZqNUfR01Ehu0pesWA5T.5gxFVpLe5yr0zpyD4%2BF%2BjvLoDulc9UDbRxmbH5pIcIg; Domain=.inrupt.net; Path=/; Expires=Wed, 08 Apr 2020 19:50:15 GMT; HttpOnly; Secure'
    ],
    date: [ 'Tue, 07 Apr 2020 19:50:15 GMT' ],
    connection: [ 'close' ]
  }
} 
And in response to a GET, headers to the same container look like this:
{
  {
    'x-powered-by': [ 'solid-server/5.2.3' ],
    vary: [ 'Accept, Authorization, 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, MS-Author-Via'
    ],
    allow: [ 'OPTIONS, HEAD, GET, PATCH, POST, PUT, DELETE' ],
    link: [
      '<.acl>; rel="acl", <.meta>; rel="describedBy", <http://www.w3.org/ns/ldp#Container>; rel="type", <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"'
    ],
    'wac-allow': [ 'user="read write append control",public="read"' ],
    'ms-author-via': [ 'SPARQL' ],
    'updates-via': [ 'wss://cxres.inrupt.net' ],
    'content-type': [ 'text/turtle' ],
    'set-cookie': [  'nssidp.sid=s%3Az1UnmegrbvAcfj4V2wurV8dCI7gfoylH.km%2FIzSslorI5xhaA8uJfCiiTk3q%2Fv6mWcY2lDud%2Blw8; Domain=.inrupt.net; Path=/; Expires=Wed, 08 Apr 2020 19:50:16 GMT; HttpOnly; Secure'
    ],
    date: [ 'Tue, 07 Apr 2020 19:50:16 GMT' ],
    connection: [ 'close' ],
    'transfer-encoding': [ 'chunked' ]
  }
}
RFC7231 requires that the header for HEAD and GET SHOULD be the same. In particular, I am flummoxed to see the differing content-type, for what reason?. I think this is a bug as I do not recall a variance to RFC7231 being documented in the Solid spec.

Closing comment (2020-04-11T03:53:15Z): Closing... duplicate of #454