fix(web): support redirect handling in fake responses

This commit is contained in:
hinotoi-agent 2026-05-20 17:01:57 +08:00 committed by Xubin Ren
parent ff173045fe
commit 25d00b1ea4

View File

@ -95,7 +95,8 @@ async def _get_with_safe_redirects(
return None, f"Redirect blocked: {error_msg}"
response = await client.get(current_url, headers=headers, follow_redirects=False)
if not response.is_redirect:
is_redirect = 300 <= response.status_code < 400
if not is_redirect:
return response, None
location = response.headers.get("location")