Allow seting CORS origin

This commit is contained in:
Craig Quiter
2024-08-18 14:17:26 -07:00
parent 446b2a334a
commit d2f10d50bf
8 changed files with 45 additions and 14 deletions

View File

@@ -119,6 +119,7 @@ from config import (
WEBUI_SESSION_COOKIE_SECURE,
ENABLE_ADMIN_CHAT_ACCESS,
AppConfig,
CORS_ALLOW_ORIGIN,
)
from constants import ERROR_MESSAGES, WEBHOOK_MESSAGES, TASKS
@@ -209,8 +210,6 @@ app.state.config.TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE = (
app.state.MODELS = {}
origins = ["*"]
##################################
#
@@ -833,7 +832,7 @@ app.add_middleware(PipelineMiddleware)
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_origins=CORS_ALLOW_ORIGIN,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],