mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-25 13:22:59 -05:00
[PR #21171] [CLOSED] feat: Allow customizing user info header names via environment variables #129614
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21171
Author: @useradd-temp
Created: 2/5/2026
Status: ❌ Closed
Base:
dev← Head:custom_user_info_header📝 Commits (1)
60c74f8feat: Allow customizing user info header names via environment variables📊 Changes
1 file changed (+5 additions, -4 deletions)
View changed files
📝
backend/open_webui/utils/headers.py(+5 -4)📄 Description
Changelog Entry
Description
Support for customizing user information header names through environment variables, while maintaining backward compatibility with the default
X-OpenWebUI-User-*headers. This allows deployments to use custom header names that fit their infrastructure requirements.Motivation:
When integrating with existing infrastructure or reverse proxies, some deployments may need to use different header names to avoid conflicts or comply with internal standards. For instance, AWS Bedrock AgentCore only accepts headers prefixed with
X-Amzn-Bedrock-AgentCore-Runtime-Custom-, making it impossible to forward user information with the hardcodedX-OpenWebUI-User-*headers. This change enables compatibility with such services while maintaining backward compatibility for existing deployments.Added
FORWARD_USER_INFO_NAME- customize the user name header (default:X-OpenWebUI-User-Name)FORWARD_USER_INFO_ID- customize the user ID header (default:X-OpenWebUI-User-Id)FORWARD_USER_INFO_EMAIL- customize the user email header (default:X-OpenWebUI-User-Email)FORWARD_USER_INFO_ROLE- customize the user role header (default:X-OpenWebUI-User-Role)Changed
include_user_info_headers()function to read header names from environment variablesos.environ.get()with fallback to original default valuesDeprecated
N/A
Removed
N/A
Fixed
N/A
Security
N/A
Breaking Changes
Fully backward compatible. If environment variables are not set, the original header names are used.
Additional Information
N/A
Screenshots or Videos
N/A
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.