This commit is contained in:
Timothy Jaeryang Baek
2026-05-11 01:15:34 +09:00
parent d11e06f1b7
commit 8d3133fe28
2 changed files with 8 additions and 0 deletions

View File

@@ -1226,6 +1226,11 @@ TERMINAL_SERVER_CONNECTIONS = PersistentConfig(
terminal_server_connections,
)
try:
TERMINAL_PROXY_HEADERS = json.loads(os.environ.get('TERMINAL_PROXY_HEADERS', '{}'))
except Exception:
TERMINAL_PROXY_HEADERS = {}
####################################
# WEBUI
####################################

View File

@@ -17,6 +17,7 @@ from starlette.background import BackgroundTask
from open_webui.utils.auth import get_verified_user
from open_webui.utils.access_control import has_connection_access
from open_webui.env import AIOHTTP_CLIENT_SESSION_SSL
from open_webui.config import TERMINAL_PROXY_HEADERS
from open_webui.models.groups import Groups
from open_webui.models.users import Users
@@ -151,6 +152,8 @@ async def proxy_terminal(
for key, value in upstream_response.headers.items()
if key.lower() not in STRIPPED_RESPONSE_HEADERS
}
if TERMINAL_PROXY_HEADERS:
filtered_headers.update(TERMINAL_PROXY_HEADERS)
# Stream binary responses directly
if any(t in upstream_content_type for t in STREAMING_CONTENT_TYPES):