gentics / mesh-incubator

Project which is home for planned enhancements for Gentics Mesh
3 stars 0 forks source link

HTTP HEAD method is not supported #202

Open afilimonov opened 6 years ago

afilimonov commented 6 years ago

Problem

HTTP HEAD request to existing node via webroot returns 404. Ability to use HEAD to check if node is modified would we very handy for implementing caching.

Reproducer

curl -v https://demo.getmesh.io/api/v1/demo/webroot/automobiles/ford-gt returns 200 status and JSON object

curl -v --head https://demo.getmesh.io/api/v1/demo/webroot/automobiles/ford-gt returns 404

Expected behaviour and actual behaviour

HTTP HEAD returns 200/304 with ETAG and other headers.

Jotschi commented 6 years ago

Thanks for the suggestion.

We would need to implement this for the following endpoints:

Jotschi commented 6 years ago

I sketched out the needed changes: https://github.com/gentics/mesh/commit/7760a468322967c7ba7c26411426046e902df65b

The RAML generation needs to be adapted to support multiple methods per endpoint route.

Jotschi commented 5 years ago

https://tools.ietf.org/html/rfc7231#section-4.3.2

Content-Length header MAY be included. We will omit this header to improve HEAD request speed.