Skip to content

Handle malformed redirect URLs in HTTP checks#2119

Open
Sanjays2402 wants to merge 1 commit into
internetstandards:mainfrom
Sanjays2402:fix/malformed-redirect-error
Open

Handle malformed redirect URLs in HTTP checks#2119
Sanjays2402 wants to merge 1 commit into
internetstandards:mainfrom
Sanjays2402:fix/malformed-redirect-error

Conversation

@Sanjays2402

Copy link
Copy Markdown

A persistent malformed redirect such as https://./ currently leaks urllib3's LocationParseError, bypassing callers that handle requests.RequestException and aborting checks such as IPv4/IPv6 content comparison. Normalize it to Requests' InvalidURL after the existing retry, with a focused regression test for the retry path.

Fixes #2032.

Malformed redirect URLs can raise urllib3 LocationParseError after retry, bypassing callers that handle requests.RequestException.

Convert persistent LocationParseError to requests InvalidURL and cover the retry path with a regression test.
@WKobes
WKobes requested a review from mxsasha July 16, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

redirect to dot results in LocationParseError: Failed to parse: '.', label empty or too long

1 participant