mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #23856] [CLOSED] fix(openai): strip upstream hop-by-hop headers in MOA proxy #50458
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/23856
Author: @bobo-xxx
Created: 4/17/2026
Status: ❌ Closed
Base:
main← Head:fix/openai-strip-hop-by-hop-headers📝 Commits (1)
f7a8e40fix(openai): strip upstream hop-by-hop headers in MOA proxy📊 Changes
1 file changed (+7 additions, -1 deletions)
View changed files
📝
backend/open_webui/routers/openai.py(+7 -1)📄 Description
Description
Fixes ERR_CONTENT_DECODING_FAILED when using 'Merge Responses' with Google/Anthropic models.
Root cause: aiohttp auto-decompresses the upstream response body but leaves the
Content-Encoding: gzipheader intact. When the server forwards this header with the already-decoded body, Chrome fails to parse it.Fix: Add
STRIPPED_RESPONSE_HEADERSconstant and filter hop-by-hop headers (transfer-encoding,connection,content-encoding,content-length) before forwarding the streaming response. This pattern is already used interminals.py.Changes:
STRIPPED_RESPONSE_HEADERS = frozenset(...)constant near line 63generate_chat_completionStreamingResponse before forwardingType of change**
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.