Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
0739b194
Unverified
Commit
0739b194
authored
Apr 02, 2024
by
A-Mahla
Committed by
GitHub
Apr 02, 2024
Browse files
[Frontend][Bugfix] allow using the default middleware with a root path (#3788)
Co-authored-by: A-Mahla <>
parent
77a6572a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
vllm/entrypoints/openai/api_server.py
vllm/entrypoints/openai/api_server.py
+2
-1
No files found.
vllm/entrypoints/openai/api_server.py
View file @
0739b194
...
@@ -127,7 +127,8 @@ if __name__ == "__main__":
...
@@ -127,7 +127,8 @@ if __name__ == "__main__":
@
app
.
middleware
(
"http"
)
@
app
.
middleware
(
"http"
)
async
def
authentication
(
request
:
Request
,
call_next
):
async
def
authentication
(
request
:
Request
,
call_next
):
if
not
request
.
url
.
path
.
startswith
(
"/v1"
):
root_path
=
""
if
args
.
root_path
is
None
else
args
.
root_path
if
not
request
.
url
.
path
.
startswith
(
f
"
{
root_path
}
/v1"
):
return
await
call_next
(
request
)
return
await
call_next
(
request
)
if
request
.
headers
.
get
(
"Authorization"
)
!=
"Bearer "
+
token
:
if
request
.
headers
.
get
(
"Authorization"
)
!=
"Bearer "
+
token
:
return
JSONResponse
(
content
=
{
"error"
:
"Unauthorized"
},
return
JSONResponse
(
content
=
{
"error"
:
"Unauthorized"
},
...
...
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