cors#
- class starlite.middleware.cors.CORSMiddleware#
Bases:
AbstractMiddlewareCORS Middleware.
- __init__(app: ASGIApp, config: CORSConfig)#
Middleware that adds CORS validation to the application.
- Parameters:
app – The
nextASGI app to call.config – An instance of
CORSConfig
- send_wrapper(send: Send, origin: str, has_cookie: bool) Send#
Wrap
sendto ensure that state is not disconnected.- Parameters:
has_cookie – Boolean flag dictating if the connection has a cookie set.
origin – The value of the
Originheader.send – The ASGI send function.
- Returns:
An ASGI send function.