[PR #17378] [CLOSED] feat: adding user headers to external web request provider #63266

Closed
opened 2026-05-06 07:54:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/17378
Author: @thomascooper
Created: 9/11/2025
Status: Closed

Base: devHead: dev


📝 Commits (1)

  • 4ed8c7d adding a helper class to attach user external web search requests

📊 Changes

2 files changed (+83 additions, -4 deletions)

View changed files

📝 backend/open_webui/retrieval/web/external.py (+7 -4)
backend/open_webui/utils/user_context.py (+76 -0)

📄 Description

Pull Request Checklist

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests to validate the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:

Changelog Entry

Description

  • Adding user headers to external web search provider if ENABLE_FORWARD_USER_INFO_HEADERS is enabled. Headers are generated using a utility class that uses the same mechanism that the Audit Logger uses to get user info. When external web search providers or observability tools need to know the user name, id, or email, this PR adds that functionality

Added

  • inject_user_headers function to wrap any request and dynamically add headers when ENABLE_FORWARD_USER_INFO_HEADERS is enabled

Changed

  • Small change to web retrieval external.py to add additional headers if required

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/17378 **Author:** [@thomascooper](https://github.com/thomascooper) **Created:** 9/11/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (1) - [`4ed8c7d`](https://github.com/open-webui/open-webui/commit/4ed8c7d310dfde04e6b15b580c67f43e6ab55319) adding a helper class to attach user external web search requests ### 📊 Changes **2 files changed** (+83 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/retrieval/web/external.py` (+7 -4) ➕ `backend/open_webui/utils/user_context.py` (+76 -0) </details> ### 📄 Description # Pull Request Checklist - [X] **Target branch:** Please verify that the pull request targets the `dev` branch. - [X] **Description:** Provide a concise description of the changes made in this pull request. - [X] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [ ] **Testing:** Have you written and run sufficient tests to validate the changes? - [X] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [X] **Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following: # Changelog Entry ### Description - Adding user headers to external web search provider if ENABLE_FORWARD_USER_INFO_HEADERS is enabled. Headers are generated using a utility class that uses the same mechanism that the Audit Logger uses to get user info. When external web search providers or observability tools need to know the user name, id, or email, this PR adds that functionality ### Added - inject_user_headers function to wrap any request and dynamically add headers when ENABLE_FORWARD_USER_INFO_HEADERS is enabled ### Changed - Small change to web retrieval external.py to add additional headers if required ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/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-05-06 07:54:55 -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#63266