@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / f2145efcb6
Fork 0

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 5, 03:30 UTC

[BugFix] KeyError on scope["method"] for realtime api websocket in AuthenticationMiddleware (#36934)

Signed-off-by: daniebrill <50454544+daniebrill@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

daniebrill committed Apr 15, 2026 at 18:15 UTC f2145efcb6dc7b5ff0ec0a321508ec7f313c6f83
1 file changed +4 -1
vllm/entrypoints/openai/server_utils.py
+4 -1
@@ -69,7 +69,10 @@ class AuthenticationMiddleware:
69 return token_match
70
71 def __call__(self, scope: Scope, receive: Receive, send: Send) -> Awaitable[None]:
72 - if scope["type"] not in ("http", "websocket") or scope["method"] == "OPTIONS":
72 + if (
73 + scope["type"] not in ("http", "websocket")
74 + or scope.get("method") == "OPTIONS"
75 + ):
76 # scope["type"] can be "lifespan" or "startup" for example,
77 # in which case we don't need to do anything
78 return self.app(scope, receive, send)