MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / Middleware

Class Middleware

tests/test_web_middleware.py:442–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440 return web.Response(body=b"OK")
441
442 class Middleware:
443 async def __call__(self, app, handler: Handler):
444 async def middleware(request):
445 resp = await handler(request)
446 assert 200 == resp.status
447 resp.set_status(201)
448 resp.text = resp.text + "[old style middleware]"
449 return resp
450
451 return middleware
452
453 with pytest.warns(DeprecationWarning) as warning_checker:
454 app = web.Application()

Calls

no outgoing calls