mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-21 21:31:08 -05:00
okay fine
This commit is contained in:
24
.venv/lib/python3.12/site-packages/channels/middleware.py
Normal file
24
.venv/lib/python3.12/site-packages/channels/middleware.py
Normal file
@@ -0,0 +1,24 @@
|
||||
class BaseMiddleware:
|
||||
"""
|
||||
Base class for implementing ASGI middleware.
|
||||
|
||||
Note that subclasses of this are not self-safe; don't store state on
|
||||
the instance, as it serves multiple application instances. Instead, use
|
||||
scope.
|
||||
"""
|
||||
|
||||
def __init__(self, inner):
|
||||
"""
|
||||
Middleware constructor - just takes inner application.
|
||||
"""
|
||||
self.inner = inner
|
||||
|
||||
async def __call__(self, scope, receive, send):
|
||||
"""
|
||||
ASGI application; can insert things into the scope and run asynchronous
|
||||
code.
|
||||
"""
|
||||
# Copy scope to stop changes going upstream
|
||||
scope = dict(scope)
|
||||
# Run the inner application along with the scope
|
||||
return await self.inner(scope, receive, send)
|
||||
Reference in New Issue
Block a user