A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 2, 23:15 UTC
[Frontend] Simplify AuthenticationMiddleware path extraction (#43426)
Signed-off-by: Russell Bryant <rbryant@redhat.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Russell Bryant committed
May 22, 2026 at 14:59 UTC
2b94d1c0caf69d4108d720986f4e792960b02cf7
1 file changed
+2
-2
vllm/entrypoints/openai/server_utils.py
+2
-2
@@ -15,7 +15,7 @@ from fastapi import FastAPI, HTTPException, Request
15
from fastapi.exceptions import RequestValidationError
16
from fastapi.responses import JSONResponse
17
from starlette.concurrency import iterate_in_threadpool
18
-from starlette.datastructures import URL, Headers, MutableHeaders
18
+from starlette.datastructures import Headers, MutableHeaders
19
from starlette.types import ASGIApp, Message, Receive, Scope, Send
20
21
from vllm import envs
@@ -80,7 +80,7 @@ class AuthenticationMiddleware:
80
# in which case we don't need to do anything
81
return self.app(scope, receive, send)
82
root_path = scope.get("root_path", "")
83
- url_path = URL(scope=scope).path.removeprefix(root_path)
83
+ url_path = scope["path"].removeprefix(root_path)
84
headers = Headers(scope=scope)
85
# Type narrow to satisfy mypy.
86
if url_path.startswith(GUARDED_PREFIX) and not self.verify_token(headers):