mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #20003 -- Improved and extended URLValidator
This adds support for authentication data (`user:password`) in URLs, IPv6 addresses, and unicode domains. The test suite has been improved by adding test URLs from http://mathiasbynens.be/demo/url-regex (with a few adjustments, like allowing local and reserved IPs). The previous URL validation regex failed this test suite on 13 occasions, the validator was updated based on https://gist.github.com/dperini/729294.
This commit is contained in:
committed by
Tim Graham
parent
6288fccfda
commit
2e65d56156
@@ -10,3 +10,39 @@ http://inv-.alid-.com
|
||||
http://inv-.-alid.com
|
||||
file://localhost/path
|
||||
git://example.com/
|
||||
http://.
|
||||
http://..
|
||||
http://../
|
||||
http://?
|
||||
http://??
|
||||
http://??/
|
||||
http://#
|
||||
http://##
|
||||
http://##/
|
||||
http://foo.bar?q=Spaces should be encoded
|
||||
//
|
||||
//a
|
||||
///a
|
||||
///
|
||||
http:///a
|
||||
foo.com
|
||||
rdar://1234
|
||||
h://test
|
||||
http:// shouldfail.com
|
||||
:// should fail
|
||||
http://foo.bar/foo(bar)baz quux
|
||||
http://-error-.invalid/
|
||||
http://-a.b.co
|
||||
http://a.b-.co
|
||||
http:/
|
||||
http://
|
||||
http://
|
||||
http://1.1.1.1.1
|
||||
http://123.123.123
|
||||
http://3628126748
|
||||
http://123
|
||||
http://.www.foo.bar/
|
||||
http://.www.foo.bar./
|
||||
http://[::1:2::3]:8080/
|
||||
http://[]
|
||||
http://[]:8080
|
||||
|
||||
Reference in New Issue
Block a user