- class litestar.middleware.csrf.CSRFMiddleware#
CSRF Middleware class.
This Middleware protects against attacks by setting a CSRF cookie with a token and verifying it in request headers.
- __init__(app: ASGIApp, config: CSRFConfig) None #
app – The
nextASGI app to call.
config – The CSRFConfig instance.
- async __call__(scope: Scope, receive: Receive, send: Send) None #
scope – The ASGI connection scope.
receive – The ASGI receive function.
send – The ASGI send function.