Skip to content

Commit

Permalink
Add description to InvalidRedirectURL raised instead of InvalidURL
Browse files Browse the repository at this point in the history
  • Loading branch information
setla committed Jan 31, 2024
1 parent 8e824fd commit 9c1c159
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aiohttp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,10 @@ async def _request(
r_url, encoded=not self._requote_redirect_url
)
except ValueError as e:
raise InvalidRedirectURL(r_url) from e
raise InvalidRedirectURL(
r_url,
"Server attempted redirecting to a location that does not look like a URL",
) from e

scheme = parsed_redirect_url.scheme
if scheme not in ("http", "https", ""):
Expand Down

0 comments on commit 9c1c159

Please sign in to comment.