Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
73178cf5
"docs_zh_CN/deployment/onnx.md" did not exist on "e4b5348ebf407f0886bc11caa7ca74d2fbf693ac"
Commit
73178cf5
authored
May 27, 2024
by
Timothy J. Baek
Browse files
refac
parent
f1a7c766
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
backend/main.py
backend/main.py
+8
-9
No files found.
backend/main.py
View file @
73178cf5
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment