mirror of
https://github.com/open-webui/computer.git
synced 2026-12-05 02:57:57 -05:00
refac
This commit is contained in:
1 parent
0086c32745
commit
a27fbb80e5
5 files changed
+113
-3
No files matched your search
+12
@@ -128,6 +128,18 @@ from cptr.utils.proxy_middleware import ProxyFallbackMiddleware
|
||||
|
||||
app.add_middleware(ProxyFallbackMiddleware)
|
||||
|
||||
# CORS middleware: uses CPTR_CORS_ALLOWED_ORIGINS env var (default "*").
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from cptr.env import CORS_ALLOWED_ORIGINS
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=CORS_ALLOWED_ORIGINS if isinstance(CORS_ALLOWED_ORIGINS, list) else ["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
||||
# Path normalization middleware (Windows: \ → / in JSON responses)
|
||||
import platform
|
||||
|
||||
Reference in new issue
Block a user