mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #23920] fix: Stale Content-Encoding header forwarded from upstream APIs causes ZlibError in desktop clients #58773
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pvyswiss on GitHub (Apr 21, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23920
Bug Description
Desktop clients (OpenCode Desktop, OnlyOffice plugin) receive
Decompression error: ZlibErrorwhen streaming SSE from Claude/OpenAI models through Open WebUI's API proxy. The Web UI works fine.Related to: #23917 (Bug 1)
Root Cause
aiohttpsendsAccept-Encoding: gzipto upstream APIs. When the upstream responds withContent-Encoding: gzip, aiohttp auto-decompresses the response body but keeps the staleContent-Encoding: gzipheader (see aiohttp#4462).openai.pyforwards all upstream headers verbatim viaheaders=dict(r.headers)at 4StreamingResponselocations. The client receivesContent-Encoding: gzipheader with plain-text body, tries to decompress, and fails.Fix
Strip encoding headers that become stale after aiohttp auto-decompression:
Applied at all 4
StreamingResponselocations inopenai.py.Impact
Content-Encodingare fixedFile
backend/open_webui/routers/openai.pyReproduction