mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[PR #18021] [CLOSED] feat(connections): add support for custom HTTP headers #24642
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/18021
Author: @mcowger
Created: 10/2/2025
Status: ❌ Closed
Base:
dev← Head:mcowger/custom-headers📝 Commits (1)
a3c5e5dfeat(connections): add support for custom HTTP headers📊 Changes
62 files changed (+489 additions, -149 deletions)
View changed files
📝
backend/open_webui/routers/ollama.py(+256 -142)📝
backend/open_webui/routers/openai.py(+46 -4)📝
src/lib/apis/openai/index.ts(+19 -2)📝
src/lib/components/AddConnectionModal.svelte(+103 -1)📝
src/lib/i18n/locales/ar-BH/translation.json(+1 -0)📝
src/lib/i18n/locales/ar/translation.json(+1 -0)📝
src/lib/i18n/locales/bg-BG/translation.json(+1 -0)📝
src/lib/i18n/locales/bn-BD/translation.json(+2 -0)📝
src/lib/i18n/locales/bo-TB/translation.json(+1 -0)📝
src/lib/i18n/locales/bs-BA/translation.json(+1 -0)📝
src/lib/i18n/locales/ca-ES/translation.json(+1 -0)📝
src/lib/i18n/locales/ceb-PH/translation.json(+1 -0)📝
src/lib/i18n/locales/cs-CZ/translation.json(+1 -0)📝
src/lib/i18n/locales/da-DK/translation.json(+1 -0)📝
src/lib/i18n/locales/de-DE/translation.json(+1 -0)📝
src/lib/i18n/locales/dg-DG/translation.json(+1 -0)📝
src/lib/i18n/locales/el-GR/translation.json(+1 -0)📝
src/lib/i18n/locales/en-GB/translation.json(+1 -0)📝
src/lib/i18n/locales/en-US/translation.json(+7 -0)📝
src/lib/i18n/locales/es-ES/translation.json(+1 -0)...and 42 more files
📄 Description
This commit introduces the ability for users to define custom HTTP headers for their Ollama and OpenAI connections. Discussion: https://github.com/open-webui/open-webui/discussions/9732
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Added
Description
Key changes include:
build_connection_headers(Ollama) andget_headers_and_cookies(OpenAI) to ensure consistent application of headers across all API calls.extract_custom_headersutility functions in both backend routers to parse user-defined headers from connection configurations.AddConnectionModal.svelteto allow users to add, edit, and remove custom header key-value pairs.This enhancement provides greater flexibility for users to configure their connections, especially for scenarios requiring specific authentication or routing headers.
Added
Changed
NA
Deprecated
NA
Removed
NA
Fixed
NA
Security
NA
Breaking Changes
Additional Information
NAS
Screenshots or Videos
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.