mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #14375] issue: UnicodeEncodeError when uploading files with non-ASCII user names and ENABLE_FORWARD_USER_INFO_HEADERS enabled #17225
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?
Originally created by @dulicon on GitHub (May 27, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14375
Check Existing Issues
Problem Description
When a user's name is registered in Korean (or other non-Latin characters), file upload operations fail with a
UnicodeEncodeError. The error occurs in the embedding generation process when theENABLE_FORWARD_USER_INFO_HEADERSsetting is enabled.Error Details:
Root Cause:
The issue stems from the HTTP header encoding limitation where the
X-OpenWebUI-User-Nameheader is set with non-ASCII characters (Korean name "테스터" in this case). HTTP headers must be encoded in Latin-1, but Korean characters cannot be represented in this encoding scheme.Steps to Reproduce:
ENABLE_FORWARD_USER_INFO_HEADERSsettingError Stack Trace Key Points:
urllib3/connection.pyat line 358:super().putheader(header, *values)X-OpenWebUI-User-Namecontains Korean characters that cannot be encoded in Latin-1Desired Solution you'd like
Primary Solution:
Fix the Unicode encoding issue by implementing proper encoding for non-ASCII characters in HTTP headers. The system should handle international character sets in user names when setting the
X-OpenWebUI-User-Nameheader value. Please investigate appropriate encoding methods that comply with HTTP header standards while preserving the original user name information.Alternative Solution:
If the primary fix is complex to implement, provide more granular control over the
ENABLE_FORWARD_USER_INFO_HEADERSsetting by adding a new configuration option that allows users to specify which headers to forward:This would allow users to forward user information without including problematic headers that contain non-ASCII characters.
Expected Behavior:
Alternatives Considered
No response
Additional Context
Server logs when the error occurred are attached below for reference.
@tjbck commented on GitHub (May 27, 2025):
PR welcome.