mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-16 23:43:03 +00:00
fix: coerce non-string custom header values to str before sending
aiohttp requires all header values to be strings. Non-string values (e.g. integers) stored in the connection headers config were passed through as-is, causing a serialization error at request time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
823a205fd2
commit
785bc2ca8c
1 changed files with 4 additions and 3 deletions
|
|
@ -223,9 +223,10 @@ async def get_headers_and_cookies(
|
|||
}
|
||||
custom_headers = {}
|
||||
for k, v in config.get('headers').items():
|
||||
if isinstance(v, str):
|
||||
for token, value in template_vars.items():
|
||||
v = v.replace(token, value)
|
||||
if not isinstance(v, str):
|
||||
v = str(v)
|
||||
for token, value in template_vars.items():
|
||||
v = v.replace(token, value)
|
||||
custom_headers[k] = v
|
||||
headers = {**headers, **custom_headers}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue