mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 00:27:41 +01:00
12 lines
388 B
Python
12 lines
388 B
Python
from starlette.types import Receive, Scope, Send
|
|
from starlette_csrf.middleware import CSRFMiddleware
|
|
|
|
|
|
class CustomCSRFMiddleware(CSRFMiddleware):
|
|
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
|
|
if scope["type"] != "http":
|
|
await self.app(scope, receive, send)
|
|
return
|
|
|
|
await super().__call__(scope, receive, send)
|