Open afilimonov opened 6 years ago
Thanks for the suggestion.
We would need to implement this for the following endpoints:
[ ] HEAD /api/v1/users/:uuid
[ ] HEAD /api/v1/users
[ ] HEAD /api/v1/roles/:uuid
[ ] HEAD /api/v1/roles
[ ] HEAD /api/v1/groups/:uuid
[ ] HEAD /api/v1/groups
[ ] HEAD /api/v1/schemas/:uuid
[ ] HEAD /api/v1/schemas
[ ] HEAD /api/v1/microschemas/:uuid
[ ] HEAD /api/v1/microschemas
[ ] HEAD /api/v1/projects/:uuid
[ ] HEAD /api/v1/projects
[ ] HEAD /api/v1/:projectName/nodes/:uuid
[ ] HEAD /api/v1/:projectName/nodes/:uuid/navigation
[ ] HEAD /api/v1/:projectName/nodes/:uuid/binary/:fieldName
[ ] HEAD /api/v1/:projectName/nodes/:uuid/children
[ ] HEAD /api/v1/:projectName/nodes/:uuid/tags
[ ] HEAD /api/v1/:projectName/nodes/:uuid/published
[ ] HEAD /api/v1/:projectName/nodes
[ ] HEAD /api/v1/:projectName/releases/:uuid
[ ] HEAD /api/v1/:projectName/releases
[ ] HEAD /api/v1/:projectName/webroot/:path
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.
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.
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.