refac
This commit is contained in:
@@ -4,7 +4,7 @@ from typing import Optional
|
||||
import time
|
||||
import re
|
||||
import aiohttp
|
||||
from open_webui.env import AIOHTTP_CLIENT_TIMEOUT
|
||||
from open_webui.env import AIOHTTP_CLIENT_SESSION_SSL, AIOHTTP_CLIENT_TIMEOUT
|
||||
from open_webui.models.groups import Groups
|
||||
from pydantic import BaseModel, HttpUrl
|
||||
from fastapi import APIRouter, Depends, HTTPException, Request, status
|
||||
@@ -274,7 +274,7 @@ async def load_tool_from_url(request: Request, form_data: LoadUrlForm, user=Depe
|
||||
async with aiohttp.ClientSession(
|
||||
trust_env=True, timeout=aiohttp.ClientTimeout(total=AIOHTTP_CLIENT_TIMEOUT)
|
||||
) as session:
|
||||
async with session.get(url, headers={'Content-Type': 'application/json'}) as resp:
|
||||
async with session.get(url, headers={'Content-Type': 'application/json'}, ssl=AIOHTTP_CLIENT_SESSION_SSL) as resp:
|
||||
if resp.status != 200:
|
||||
raise HTTPException(status_code=resp.status, detail='Failed to fetch the tool')
|
||||
data = await resp.text()
|
||||
|
||||
Reference in New Issue
Block a user