#36934 [BugFix] KeyError on scope["method"] for realtime api websocket in AuthenticationMiddleware
作者 daniebrill · 合并时间 2026-04-16 00:15
修复实时API WebSocket认证中间件因scope["method"]键缺失导致的KeyError。
该PR值得快速浏览,重点关注AuthenticationMiddleware中scope字典键访问的安全处理模式,这是一个常见的ASGI中间件设计要点。虽然变更简单,但揭示了WebSocket与HTTP scope结构的差异,对处理多协议认证有参考价值。
参与讨论