HomeSoftware Heritage

api/graph: Fix error responses for invalid request Accept header

Description

api/graph: Fix error responses for invalid request Accept header

When setting an unsupported value for the request Accept header when
querying the /api/1/graph/ endpoint, an error was raised as the Django
DRF response does not have the accepted_media_type attribute set in
that case, leading to a 500 HTTP status code.

So ensure a proper JSON error response will be generated with the
406 HTTP status code when submitting such requests.

Details

Provenance
anlambertAuthored on Oct 25 2021, 1:40 PM
anlambertPushed on Oct 25 2021, 3:44 PM
Differential Revision
D6546: api/graph: Fix error responses for invalid request Accept header
Parents
rDWAPPS1edcf35c4849: coverage: Drop the cran origins computation workaround
Branches
Unknown
Tags
Unknown
Build Status
Buildable 24682
Build 38517: test-and-buildJenkins console · Jenkins