mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #23876] [CLOSED] fix(openai): strip hop-by-hop headers from proxied SSE responses #66277
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23876
Author: @CodeLine9
Created: 4/19/2026
Status: ❌ Closed
Base:
main← Head:clawoss/fix/merge-responses-content-decoding📝 Commits (1)
f9db8b3fix(openai): strip hop-by-hop headers from proxied SSE responses📊 Changes
1 file changed (+9 additions, -1 deletions)
View changed files
📝
backend/open_webui/routers/openai.py(+9 -1)📄 Description
Problem
Merge Responses (MOA) using Google/Anthropic API models fails with browser error
ERR_CONTENT_DECODING_FAILEDon the/api/v1/tasks/moa/completionsendpoint. The request returns 200 OK but the browser cannot decode the body.Root Cause
When proxying streaming responses from Anthropic/Google APIs through aiohttp, the session auto-decompresses the response body (default
auto_decompress=True), but the upstreamcontent-encoding: gzipheader is forwarded unchanged. The browser receives a decoded plaintext body with a header claiming it is gzip-encoded, causing the decoding failure.Fix
Strip hop-by-hop and transport headers (
transfer-encoding,connection,content-encoding,content-length) from the forwardedStreamingResponseheaders ingenerate_chat_completion. This mirrors the existing pattern already used interminals.py.Fixes #23855
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.