Skip to content
Snippets Groups Projects
Commit 4a20ead8 authored by David Douard's avatar David Douard
Browse files

api/async: add support for content negotiation

For the content negotiation to work, we expect handler functions to
return an aiohttp_utils.Response object instead of an aiohttp.Response one
so we can handle the serialization in the "main" middleware (error_middleware,
which should probably be renamed).

swh.core.api.asynchronous.encode_data_server() can still be used; it will
produce a correct Response object if negotitation is in use.

It should still work with server handler implementations that do
produce aiohttp.Response objects, but without the content negotitation
feature available then.

This adds a dependency on the aiohttp_utils python package.
parent 13c18d78
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment