diff --git a/backend/main.py b/backend/main.py index 3d1ed6c2d..165ba24b6 100644 --- a/backend/main.py +++ b/backend/main.py @@ -118,15 +118,15 @@ origins = ["*"] # Custom middleware to add security headers -class SecurityHeadersMiddleware(BaseHTTPMiddleware): - async def dispatch(self, request: Request, call_next): - response: Response = await call_next(request) - response.headers["Cross-Origin-Opener-Policy"] = "same-origin" - response.headers["Cross-Origin-Embedder-Policy"] = "require-corp" - return response +# class SecurityHeadersMiddleware(BaseHTTPMiddleware): +# async def dispatch(self, request: Request, call_next): +# response: Response = await call_next(request) +# response.headers["Cross-Origin-Opener-Policy"] = "same-origin" +# response.headers["Cross-Origin-Embedder-Policy"] = "require-corp" +# return response -app.add_middleware(SecurityHeadersMiddleware) +# app.add_middleware(SecurityHeadersMiddleware) class RAGMiddleware(BaseHTTPMiddleware): @@ -289,8 +289,8 @@ class ModelFilterConfigForm(BaseModel): async def update_model_filter_config( form_data: ModelFilterConfigForm, user=Depends(get_admin_user) ): - app.state.config.ENABLE_MODEL_FILTER, form_data.enabled - app.state.config.MODEL_FILTER_LIST, form_data.models + app.state.config.ENABLE_MODEL_FILTER = form_data.enabled + app.state.config.MODEL_FILTER_LIST = form_data.models ollama_app.state.ENABLE_MODEL_FILTER = app.state.config.ENABLE_MODEL_FILTER ollama_app.state.MODEL_FILTER_LIST = app.state.config.MODEL_FILTER_LIST