mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-24 18:42:35 +00:00
fix(web): support redirect handling in fake responses
This commit is contained in:
parent
ff173045fe
commit
25d00b1ea4
@ -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")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user