open-webui/backend/open_webui
Classic298 d0f759ce40
fix: capture uncompressed response bodies in audit logs (#27369)
CompressMiddleware was registered before AuditLoggingMiddleware. Starlette prepends on add_middleware, so the audit layer ended up outside compression and, at the REQUEST_RESPONSE level, recorded the zstd/brotli/gzip bytes of every response, decoded with errors='replace'. Any client that sent Accept-Encoding (i.e. every browser) therefore produced audit entries whose response_object was unreadable mojibake.

Registering the audit middleware before the compression middleware places it inside compression, so it observes the response body exactly as the route produced it while the client still receives the compressed stream.

Verified with a stacked ASGI harness: in the old order the captured body is not parseable; in the new order the captured body round-trips as the original JSON and the client response stays compressed.
2026-07-23 18:09:40 -05:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal perf: cut per-request database session overhead (#27385) 2026-07-23 17:49:48 -05:00
migrations chore: format 2026-07-23 13:41:16 -04:00
models perf: drop redundant session.refresh calls after commit across the model layer (#27381) 2026-07-23 18:08:00 -05:00
retrieval Forward user info headers to Mistral OCR API (#27253) 2026-07-23 12:33:19 -05:00
routers feat: add LDAP group synchronization support (#27263) 2026-07-23 13:20:55 -05:00
socket perf: cut repeated per-model work out of model list assembly 2026-07-23 19:05:32 -04:00
static refac 2026-07-20 22:27:13 -04:00
storage refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
tools refac 2026-07-23 03:39:30 -04:00
utils fix: report sub-second timings in the X-Process-Time header (#27368) 2026-07-23 18:09:23 -05:00
__init__.py refac 2026-06-17 03:01:11 +02:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac 2026-07-14 17:34:00 -04:00
constants.py refac 2026-06-29 05:46:51 -05:00
env.py refac 2026-07-09 17:28:05 -05:00
events.py Log upstream provider rejections at warn/error level (#27238) 2026-07-23 03:42:48 -04:00
functions.py refac 2026-07-23 03:39:56 -04:00
main.py fix: capture uncompressed response bodies in audit logs (#27369) 2026-07-23 18:09:40 -05:00
tasks.py refac 2026-07-16 21:57:43 -04:00