You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
uri: upper-case schemes are rejected although url() accepts them (HTTP://EXAMPLE.COM) #584
uri chooses a branch with value.startswith("http"), value.startswith("mailto:"), … on the raw value, so the scheme comparison is case-sensitive. A URI whose scheme is written in upper or mixed case falls through every branch and is rejected, although url (which lower-cases the scheme through urllib.parse.urlsplit) accepts the same string.
RFC 3986 §3.1: "schemes are case-insensitive … an implementation should accept uppercase letters as equivalent to lowercase in scheme names". A URL accepted by url should also be accepted by uri.
Proposed fix
Lower-case the scheme (the part before the first :) before dispatching. A PR follows.
Found while writing specification-based tests for a university software-testing project (NYCU). The investigation and this write-up were done with the help of an AI assistant (Claude Code); the reproduction was run on the current master.
Activity