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
9216b9cc
Unverified
Commit
9216b9cc
authored
May 16, 2024
by
Pierre Dulac
Committed by
GitHub
May 16, 2024
Browse files
[Bugfix] Bypass authorization API token for preflight requests (#4862)
parent
5e0391c0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
vllm/entrypoints/openai/api_server.py
vllm/entrypoints/openai/api_server.py
+2
-0
No files found.
vllm/entrypoints/openai/api_server.py
View file @
9216b9cc
...
...
@@ -154,6 +154,8 @@ if __name__ == "__main__":
@
app
.
middleware
(
"http"
)
async
def
authentication
(
request
:
Request
,
call_next
):
root_path
=
""
if
args
.
root_path
is
None
else
args
.
root_path
if
request
.
method
==
"OPTIONS"
:
return
await
call_next
(
request
)
if
not
request
.
url
.
path
.
startswith
(
f
"
{
root_path
}
/v1"
):
return
await
call_next
(
request
)
if
request
.
headers
.
get
(
"Authorization"
)
!=
"Bearer "
+
token
:
...
...
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