Files
open-webui/backend/open_webui
Classic298andClaude 8ace4f0a8a perf: stop recomputing static work in per-response ASGI middlewares (#27229)
SecurityHeadersMiddleware called set_security_headers() on every
response — 14 os.environ.get lookups plus a regex validation per
configured header, for values that are static for the process
lifetime. Compute the header list once at construction; when no
security env vars are set, skip wrapping send entirely.

RedirectMiddleware decoded and parse_qs'd the query string of every
GET, though it only acts on /watch?v= and ?shared= URLs. Add a cheap
path/substring precheck first; a false positive just falls through to
the previous full parse, so no redirect behavior changes.

Verified byte-identical responses (status, Location, header values)
against the previous implementations across redirect, passthrough,
and no-env cases.


Claude-Session: https://claude.ai/code/session_01MHg5zs1VBjvRWQ54qHpfYD

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-23 12:29:01 -04:00
..
…
2026-06-29 12:40:20 -05:00
2026-07-23 03:01:01 -04:00
2026-07-23 04:16:14 -04:00
2026-07-20 22:11:42 -04:00
2026-07-20 22:27:13 -04:00
2026-07-23 03:39:30 -04:00
2026-06-17 03:01:11 +02:00
2026-07-14 17:34:00 -04:00
2026-06-29 05:46:51 -05:00
2026-07-09 17:28:05 -05:00
2026-07-23 03:39:56 -04:00
2026-07-23 04:16:14 -04:00
2026-07-16 21:57:43 -04:00