Repository navigation
fix(uri): treat the scheme case-insensitively - #587
Open
yuchengshen931122-creator wants to merge 1 commit into
Open
yuchengshen931122-creator wants to merge 1 commit into
yuchengshen931122-creator wants to merge 1 commit into
Conversation
`uri` compared scheme prefixes on the raw value, so `HTTP://EXAMPLE.COM` was rejected although `url` accepts it. RFC 3986 3.1: schemes are case-insensitive. Lower-case the scheme before dispatching. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #584.
What
uricompared scheme prefixes on the raw value, soHTTP://EXAMPLE.COMandMAILTO:user@example.comwere rejected althoughurlaccepts them. RFC 3986 §3.1: schemes are case-insensitive. The scheme (the part before the first:) is now lower-cased before dispatching; the rest of the value is untouched, so host, path and the e-mail address keep their case.Tests
test_accepts_scheme_in_any_case(6 cases: http, https, mailto, file, telnet, urn) – fails on master, passes with this change.uv run pytest .(1,580 passed),ruff format .,ruff check .,pyright .(0 errors).Found while writing specification-based tests for a university software-testing project (NYCU). The change and this description were prepared with the help of an AI assistant (Claude Code).
🤖 Generated with Claude Code