mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 20:35:19 +00:00
refac/fix
This commit is contained in:
parent
8f48e96f5e
commit
80388855f4
3 changed files with 5 additions and 5 deletions
|
|
@ -144,7 +144,7 @@ class ToolServerConnection(BaseModel):
|
|||
path: str
|
||||
type: Optional[str] = "openapi" # openapi, mcp
|
||||
auth_type: Optional[str]
|
||||
headers: Optional[dict]
|
||||
headers: Optional[dict | str] = None
|
||||
key: Optional[str]
|
||||
config: Optional[dict]
|
||||
|
||||
|
|
@ -286,7 +286,7 @@ async def verify_tool_servers_config(
|
|||
if token:
|
||||
headers = {"Authorization": f"Bearer {token}"}
|
||||
|
||||
if form_data.headers:
|
||||
if form_data.headers and isinstance(form_data.headers, dict):
|
||||
if headers is None:
|
||||
headers = {}
|
||||
headers.update(form_data.headers)
|
||||
|
|
@ -332,7 +332,7 @@ async def verify_tool_servers_config(
|
|||
if token:
|
||||
headers = {"Authorization": f"Bearer {token}"}
|
||||
|
||||
if form_data.headers:
|
||||
if form_data.headers and isinstance(form_data.headers, dict):
|
||||
if headers is None:
|
||||
headers = {}
|
||||
headers.update(form_data.headers)
|
||||
|
|
|
|||
|
|
@ -1380,7 +1380,7 @@ async def process_chat_payload(request, form_data, user, metadata, model):
|
|||
oauth_token = None
|
||||
|
||||
connection_headers = mcp_server_connection.get("headers", None)
|
||||
if connection_headers:
|
||||
if connection_headers and isinstance(connection_headers, dict):
|
||||
for key, value in connection_headers.items():
|
||||
headers[key] = value
|
||||
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ async def get_tools(
|
|||
)
|
||||
|
||||
connection_headers = tool_server_connection.get("headers", None)
|
||||
if connection_headers:
|
||||
if connection_headers and isinstance(connection_headers, dict):
|
||||
for key, value in connection_headers.items():
|
||||
headers[key] = value
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue