Skip to content

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.

Related sentry issue


Migrated from D6546 (view on Phabricator)

Merge request reports