mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-17 19:54:00 +02:00
Merge pull request #3293 from thecaptain789/fix-httpx-proxy-arg
fix(fetch): update to httpx 0.28+ proxy parameter
This commit is contained in:
@@ -16,7 +16,7 @@ classifiers = [
|
||||
"Programming Language :: Python :: 3.10",
|
||||
]
|
||||
dependencies = [
|
||||
"httpx<0.28",
|
||||
"httpx>=0.27",
|
||||
"markdownify>=0.13.1",
|
||||
"mcp>=1.1.3",
|
||||
"protego>=0.3.1",
|
||||
|
||||
@@ -72,7 +72,7 @@ async def check_may_autonomously_fetch_url(url: str, user_agent: str, proxy_url:
|
||||
|
||||
robot_txt_url = get_robots_txt_url(url)
|
||||
|
||||
async with AsyncClient(proxies=proxy_url) as client:
|
||||
async with AsyncClient(proxy=proxy_url) as client:
|
||||
try:
|
||||
response = await client.get(
|
||||
robot_txt_url,
|
||||
@@ -116,7 +116,7 @@ async def fetch_url(
|
||||
"""
|
||||
from httpx import AsyncClient, HTTPError
|
||||
|
||||
async with AsyncClient(proxies=proxy_url) as client:
|
||||
async with AsyncClient(proxy=proxy_url) as client:
|
||||
try:
|
||||
response = await client.get(
|
||||
url,
|
||||
|
||||
@@ -323,4 +323,4 @@ class TestFetchUrl:
|
||||
)
|
||||
|
||||
# Verify AsyncClient was called with proxy
|
||||
mock_client_class.assert_called_once_with(proxies="http://proxy.example.com:8080")
|
||||
mock_client_class.assert_called_once_with(proxy="http://proxy.example.com:8080")
|
||||
|
||||
Reference in New Issue
Block a user