This commit is contained in:
Classic298 2026-04-02 14:54:55 +02:00 • committed by DrMelone
parent 8921a01660
commit 13c53b89c1

View file

@ -2881,6 +2881,8 @@ async def upload_file_to_terminal(
local_path = Storage.get_file(file_record.path)
# --- 2. Resolve terminal connection ---
from open_webui.utils.access_control import has_connection_access
terminal_url = None
headers = {}
@ -2889,6 +2891,8 @@ async def upload_file_to_terminal(
(c for c in connections if c.get('id') == terminal_id), None
)
if connection:
if not has_connection_access(UserModel(**__user__), connection):
return json.dumps({'error': 'Access denied to terminal server'})
terminal_url = connection.get('url', '').rstrip('/')
auth_type = connection.get('auth_type', 'bearer')
if auth_type == 'bearer':