File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -180,3 +180,4 @@ Contributors (chronological)
180180- Nicolas Simonds `@0xDEC0DE <https://github.com/0xDEC0DE >`_
181181- Florian Laport `@Florian-Laport <https://github.com/Florian-Laport >`_
182182- `@agentgodzilla <https://github.com/agentgodzilla >`_
183+ - Xiao `@T90REAL <https://github.com/T90REAL >`_
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ def __init__(
187187 self .relative = relative
188188 self .absolute = absolute
189189 self .error : str = error or self .default_message
190- self .schemes = schemes or self .default_schemes
190+ self .schemes = { s . lower () for s in schemes } if schemes else self .default_schemes
191191 self .require_tld = require_tld
192192
193193 def _repr_args (self ) -> str :
Original file line number Diff line number Diff line change @@ -205,6 +205,14 @@ def test_url_custom_scheme():
205205 assert validator (url ) == url
206206
207207
208+ def test_url_custom_scheme_case_insensitive ():
209+ validator = validate .URL (schemes = {"HTTP" })
210+ assert validator ("http://example.com" ) == "http://example.com"
211+
212+ validator = validate .URL (schemes = {"HtTp" })
213+ assert validator ("hTtP://example.com" ) == "hTtP://example.com"
214+
215+
208216@pytest .mark .parametrize (
209217 "valid_url" ,
210218 (
You can’t perform that action at this time.
0 commit comments