Page MenuHomeSoftware Heritage

REST server: support HEAD requests
ClosedPublic

Authored by zack on Nov 9 2019, 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 Compressed graph representation
Branch
feature/http-head-reqs
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 8946
Build 13068: tox-on-jenkinsJenkins
Build 13067: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Nov 12 2019, 1:13 AM

REST server: support HEAD requests

REST server: support HEAD requests

Updating D2247: REST server: support HEAD requests

Closed in f9bdeef394329857c3500f0842e72a031aa996ff