mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-13 23:14:11 +00:00
refac
This commit is contained in:
parent
ffae4116a8
commit
7a4a4b93dc
1 changed files with 3 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import logging
|
||||
import time
|
||||
from string import punctuation
|
||||
from typing import Any, Optional
|
||||
from urllib.parse import quote
|
||||
|
||||
|
|
@ -156,6 +157,7 @@ def parse_custom_headers(
|
|||
value = str(value)
|
||||
for token, val in template_vars.items():
|
||||
value = value.replace(token, val)
|
||||
parsed_headers[key] = value
|
||||
# Encode Unicode and controls after substitution; preserve ASCII header syntax and existing escapes.
|
||||
parsed_headers[key] = quote(value, safe=punctuation + ' \t')
|
||||
|
||||
return parsed_headers
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue