[PR #15412] [CLOSED] fix: Forward response headers #23813

Closed
opened 2026-04-20 05:03:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/15412
Author: @Simon-Stone
Created: 7/1/2025
Status: Closed

Base: devHead: forward_response_headers


📝 Commits (6)

  • de018f0 refac
  • 55fb890 forward response headers for non-streaming requests
  • 80975a3 handle Response object
  • b199894 preserve old behavior if processed response is not a Response object
  • 9d5e132 preserve return type
  • 3949535 ensure Response object is turned into dict where needed

📊 Changes

4 files changed (+72 additions, -29 deletions)

View changed files

📝 backend/open_webui/routers/openai.py (+14 -5)
📝 backend/open_webui/utils/middleware.py (+58 -22)
📝 backend/requirements.txt (+0 -1)
📝 pyproject.toml (+0 -1)

📄 Description

Changelog Entry

Description

  • Instead of only returning the payload of the response, we make sure that a proper Response object is constructed that includes the upstream API's response headers.

Added

  • Response headers are preserved for non-streaming chat completion requests.

Changed

  • Changed the response construction for non-streaming requests

Fixed


Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/15412 **Author:** [@Simon-Stone](https://github.com/Simon-Stone) **Created:** 7/1/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `forward_response_headers` --- ### 📝 Commits (6) - [`de018f0`](https://github.com/open-webui/open-webui/commit/de018f091260ae757a61e9e4d8691be6442e3ea6) refac - [`55fb890`](https://github.com/open-webui/open-webui/commit/55fb89082fdec1634b1dfd8c9add064acbd718d5) forward response headers for non-streaming requests - [`80975a3`](https://github.com/open-webui/open-webui/commit/80975a3edc7f71e0008ab28384e26c8dc79f5251) handle Response object - [`b199894`](https://github.com/open-webui/open-webui/commit/b199894d51ffcf6bc8dcf854d6b57bb8ff4dd7c3) preserve old behavior if processed response is not a Response object - [`9d5e132`](https://github.com/open-webui/open-webui/commit/9d5e132d06d69e9395dbd5b6e9b506d9118d878e) preserve return type - [`3949535`](https://github.com/open-webui/open-webui/commit/3949535408c0e6db43e54c7b1e863fcfcf7c8d76) ensure Response object is turned into dict where needed ### 📊 Changes **4 files changed** (+72 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/routers/openai.py` (+14 -5) 📝 `backend/open_webui/utils/middleware.py` (+58 -22) 📝 `backend/requirements.txt` (+0 -1) 📝 `pyproject.toml` (+0 -1) </details> ### 📄 Description # Changelog Entry ### Description - Instead of only returning the payload of the response, we make sure that a proper `Response` object is constructed that includes the upstream API's response headers. ### Added - Response headers are preserved for non-streaming chat completion requests. ### Changed - Changed the response construction for non-streaming requests ### Fixed - Fixes issue #15411 --- ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 05:03:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#23813