Skip to content

Commit 0b20a91

Browse files
authored
Merge pull request #98 from ant-xuexiao/fix/revert-cors-header
fix: revert cors header
2 parents d49a311 + 01673f5 commit 0b20a91

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

server/main.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import uvicorn
44
from fastapi import FastAPI
55
from fastapi.responses import StreamingResponse
6-
6+
from fastapi.middleware.cors import CORSMiddleware
77
from agent import stream
88

99
from uilts.env import get_env_variable
@@ -21,6 +21,15 @@
2121
description="Agent Chat APIs"
2222
)
2323

24+
app.add_middleware(
25+
CORSMiddleware,
26+
allow_origins=["*"],
27+
allow_credentials=True,
28+
allow_methods=["*"],
29+
allow_headers=["*"],
30+
expose_headers=["*"],
31+
)
32+
2433
app.include_router(health_checker.router)
2534
app.include_router(github.router)
2635
app.include_router(rag.router)

0 commit comments

Comments
 (0)