Skip to content

HEAD response status and headers are not equivalent to those of a GET response #2517

@loesak

Description

@loesak

My understanding of the specification is that the response from a HEAD request should be (nearly) identical to a GET request with the main exception is that there is no body returned on a HEAD request. Other than that, the status code should be the same and the headers should be the same.

RepositoryEntityController#headCollectionResource returns a 204 when the GET response would return a 200. It is also missing headers for Content-Type and Transfer-Encoding. If the resource is not found, it correctly returns a 404.

RepositoryEntityController#headForItemResource returns a 204 when the GET response would return a 200 OK. In the case of using ETag value to set the request header If-None-Match or similar, if the GET request were to return a 304 Not Modified, the HEAD version of the same request still returns a 204 No Content. It's also adding a Cache-Control header where as the GET request does not.

I haven't checked other endpoints.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions