INNER CODE UNIT · Python

__call__

SHAdd0WTAka/Zen-Ai-Pentest · api/main.py:555

    async def __call__(self, scope, receive, send):
        if scope["type"] == "http":
            headers = dict(scope.get("headers", []))
            origin = headers.get(b"origin", b"").decode() if b"origin" in headers else None
            if origin and is_origin_allowed(origin):
                scope["cors_origin"] = origin
        await self.app(scope, receive, send)


app.add_middleware(
    CORSMiddleware,
    allow_origins=ALL_ALLOWED_ORIGINS,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
    expose_headers=["X-Request-ID", "X-RateLimit-Remaining", "X-RateLimit-Reset"],
    max_age=86400,
)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…