-
- Downloads
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.
Loading
Please register or sign in to comment