diff --git a/server/auth/cors_middleware.py b/server/auth/cors_middleware.py index 4f3c0700..367838ea 100644 --- a/server/auth/cors_middleware.py +++ b/server/auth/cors_middleware.py @@ -28,6 +28,5 @@ async def dispatch(self, request: Request, call_next: Callable[[Request], Awaita def mutate_cors_headers(self, request: Request, response: Response): requested_origin = request.headers.get('origin') headers = response.headers - headers["Access-Control-Allow-Origin"] = requested_origin return headers diff --git a/server/auth/middleware.py b/server/auth/middleware.py index 1b33694a..44a8912e 100644 --- a/server/auth/middleware.py +++ b/server/auth/middleware.py @@ -23,7 +23,7 @@ ] ANONYMOUS_USER_ALLOW_LIST = [ - "/api/auth/userinfo" + "/api/auth/userinfo", "/api/chat/qa", "/api/chat/stream_qa", ] @@ -53,8 +53,8 @@ async def oauth(self, request: Request): async def dispatch(self, request: Request, call_next: Callable[[Request], Awaitable[Response]]) -> Response: try: - if ENVRIMENT == "development": - return await call_next(request) + # if ENVRIMENT == "development": + # return await call_next(request) # Auth 相关的直接放过 if request.url.path.startswith("/api/auth"):