Skip to content

Commit 81c608e

Browse files
committed
Handle query strings in URLs without a path
1 parent 931f507 commit 81c608e

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎tests/test_url.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
u'http://foo.com/blah_blah_(wikipedia)_(again)',
1616
u'http://www.example.com/wpstyle/?p=364',
1717
u'https://www.example.com/foo/?bar=baz&inga=42&quux',
18+
u'https://www.example.com?bar=baz',
1819
u'http://✪df.ws/123',
1920
u'http://userid:password@example.com:8080',
2021
u'http://userid:password@example.com:8080/',

‎validators/url.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
u"(?::\d{2,5})?"
4141
# resource path
4242
u"(?:/\S*)?"
43+
# query string
44+
u"(?:\?\S*)?"
4345
u"$",
4446
re.UNICODE | re.IGNORECASE
4547
)

0 commit comments

Comments
 (0)