Skip to content

Commit 8d5cef5

Browse files
committed
Make URL validator case insensitive
1 parent 744628d commit 8d5cef5

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎CHANGES.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ Changelog
22
---------
33

44

5+
0.10.4 (2016-08-30)
6+
^^^^^^^^^^^^^^^^^^^
7+
8+
- Fixed public url validation (#29)
9+
- Made URL validator case insensitive (#27)
10+
11+
512
0.10.3 (2016-06-13)
613
^^^^^^^^^^^^^^^^^^^
714

‎tests/test_url.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
u'http://foobar.dk',
99
u'http://foobar.museum/foobar',
1010
u'http://fo.com',
11+
u'http://FOO.com',
1112
u'http://foo.com/blah_blah',
1213
u'http://foo.com/blah_blah/',
1314
u'http://foo.com/blah_blah_(wikipedia)',

‎validators/url.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
u"(?::\d{2,5})?"
4141
# resource path
4242
u"(?:/\S*)?"
43-
u"$", re.UNICODE
43+
u"$",
44+
re.UNICODE | re.IGNORECASE
4445
)
4546

4647
pattern = re.compile(regex)
@@ -84,6 +85,10 @@ def url(value, public=False):
8485
8586
Added ``public`` parameter.
8687
88+
.. versionchanged:: 0.10.4
89+
90+
Made the regular expression this function uses case insensitive.
91+
8792
:param value: URL address string to validate
8893
:param public: (default=False) Set True to only allow a public IP address
8994
"""

0 commit comments

Comments
 (0)