Skip to content

Commit 1778cc7

Browse files
authored
follows redirects on checking robots.txt
1 parent 6a78795 commit 1778cc7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/fetch/src/mcp_server_fetch/server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ async def check_may_autonomously_fetch_url(url: AnyUrl | str, user_agent: str) -
7474
async with AsyncClient() as client:
7575
try:
7676
response = await client.get(
77-
robot_txt_url, headers={"User-Agent": user_agent}
77+
robot_txt_url,
78+
follow_redirects=True,
79+
headers={"User-Agent": user_agent},
7880
)
7981
except HTTPError:
8082
raise McpError(

0 commit comments

Comments
 (0)