"docs_zh_CN/deployment/onnx.md" did not exist on "e4b5348ebf407f0886bc11caa7ca74d2fbf693ac"
Commit 73178cf5 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

refac

parent f1a7c766
...@@ -118,6 +118,14 @@ app.state.MODELS = {} ...@@ -118,6 +118,14 @@ app.state.MODELS = {}
origins = ["*"] origins = ["*"]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Custom middleware to add security headers # Custom middleware to add security headers
# class SecurityHeadersMiddleware(BaseHTTPMiddleware): # class SecurityHeadersMiddleware(BaseHTTPMiddleware):
...@@ -221,15 +229,6 @@ class RAGMiddleware(BaseHTTPMiddleware): ...@@ -221,15 +229,6 @@ class RAGMiddleware(BaseHTTPMiddleware):
app.add_middleware(RAGMiddleware) app.add_middleware(RAGMiddleware)
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.middleware("http") @app.middleware("http")
async def check_url(request: Request, call_next): async def check_url(request: Request, call_next):
if len(app.state.MODELS) == 0: if len(app.state.MODELS) == 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment