Files
open-webui/backend/open_webui/utils
0f8846b7fc fix: convert SecurityHeadersMiddleware to pure ASGI (#26924)
SecurityHeadersMiddleware was the last middleware in the stack still
subclassing BaseHTTPMiddleware, after CommitSession, AuthToken,
WebsocketUpgradeGuard and Redirect were all moved to pure ASGI in
utils/asgi_middleware.py. BaseHTTPMiddleware re-buffers the response
body through an anyio task group, which has known issues with
streaming and Content-Length-bearing responses (e.g. the FileResponse
returned by /api/v1/audio/speech).

Reimplement it as a pure-ASGI middleware that stamps the configured
security headers onto the http.response.start message via
MutableHeaders and forwards all body chunks untouched, matching the
pattern already used by its four siblings. set_security_headers() and
all its helpers are unchanged.

Co-authored-by: classic298 <classic298@users.noreply.github.com>
2026-07-10 13:29:14 -05:00
..
2026-06-29 11:53:29 -05:00
2026-07-01 02:48:29 -05:00
2026-06-29 11:56:00 -05:00
2026-07-09 17:28:34 -05:00
2026-06-17 00:36:34 +02:00
2026-06-17 02:52:35 +02:00
2026-06-29 03:58:00 -05:00
2026-07-01 02:49:28 -05:00
2026-07-09 17:33:30 -05:00
2026-07-09 17:28:34 -05:00
2026-06-01 13:56:55 -07:00
2026-07-01 03:35:46 -05:00
2026-07-09 17:38:19 -05:00
2026-06-29 13:03:14 -05:00
2026-07-09 17:28:34 -05:00
2026-07-01 02:57:29 -05:00
2026-06-29 00:18:40 -05:00
2026-07-09 17:28:34 -05:00
2026-06-23 23:35:44 +02:00
2026-06-19 00:16:06 +02:00
2026-07-09 17:37:04 -05:00
2026-06-01 13:56:55 -07:00
2026-06-29 12:29:10 -05:00
2026-06-29 13:03:14 -05:00