MCPcopy
hub / github.com/aio-libs/aiohttp / middleware

Function middleware

tests/test_web_middleware.py:17–22  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

15
16 @asyncio.coroutine
17 def middleware(request):
18 resp = yield from handler(request)
19 assert 200 == resp.status
20 resp.set_status(201)
21 resp.text = resp.text + '[MIDDLEWARE]'
22 return resp
23 return middleware
24
25 app, client = yield from create_app_and_client()

Callers

nothing calls this directly

Calls 2

set_statusMethod · 0.80
handlerFunction · 0.70

Tested by

no test coverage detected