Page MenuHomeSoftware Heritage

REST server: support HEAD requests
ClosedPublic

Authored by zack on Sat, Nov 9, 11:08 AM.

Details

Reviewers
seirl
Summary

Current implementation of the REST server only supports GET requests,
supporting HEAD requests would be nice too. This diff is the key ingredient,
but it's not enough yet. In particular, HEAD requests on routes that use
get_simple_traversal_handler, visit_paths, and walk make the server side
explode with tracebacks when the web app tries to write the response body.

We should change it to not try to write body if the request is HEAD, but I'm
not sure what's the most elegant way to do so in aiohttp. There is built-in
support for that to some extent (see: https://github.com/aio-libs/aiohttp/pull/838 ),
but it's not working out of the box with the above methods.

I'm also pushing this to branch feature/http-head-reqs

Diff Detail

Repository
rDGRPH Graph service
Branch
feature/http-head-reqs
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 8948
Build 13072: tox-on-jenkinsJenkins
Build 13071: arc lint + arc unit

Event Timeline

zack created this revision.Sat, Nov 9, 11:08 AM
seirl accepted this revision.Tue, Nov 12, 1:13 AM
This revision is now accepted and ready to land.Tue, Nov 12, 1:13 AM
zack updated this revision to Diff 7761.Tue, Nov 12, 8:34 AM

REST server: support HEAD requests

zack updated this revision to Diff 7767.Tue, Nov 12, 11:38 AM

REST server: support HEAD requests

zack updated this revision to Diff 7769.Tue, Nov 12, 12:26 PM

Updating D2247: REST server: support HEAD requests