Skip to content

Accept case-insensitive URI schemes - #538

Open
Plastic-time wants to merge 1 commit into
python-validators:masterfrom
Plastic-time:codex/uri-case-insensitive-schemes
Open

Plastic-time wants to merge 1 commit into
python-validators:masterfrom
Plastic-time:codex/uri-case-insensitive-schemes

Conversation

@Plastic-time

Copy link
Copy Markdown

uri("HTTP://example.com") currently fails even though the equivalent lowercase URI passes. The same happens for mixed-case mailto, file, telnet, and other supported schemes.

Normalize only the scheme before dispatching to the existing validators, as required by RFC 3986 section 3.1. Paths, credentials, and other components retain their original case, and scheme-specific validation still applies.

Validation on Python 3.12: 24 new case-variation cases failed before the fix; all 1,543 tests pass afterward. tox -e lint,type,format,sast also passes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant