urlutils: Strip URL before testing.

This commit is contained in:
Florian Bruhin 2014-09-02 07:11:01 +02:00
parent 892c02268a
commit 96c1d53222
2 changed files with 3 additions and 0 deletions

View File

@ -126,6 +126,7 @@ class IsUrlTests(unittest.TestCase):
'http://foobar',
'localhost:8080',
'qutebrowser.org',
' qutebrowser.org ',
'127.0.0.1',
'::1',
'2001:41d0:2:6c11::1',

View File

@ -193,6 +193,8 @@ def is_url(urlstr):
log.url.debug("Checking if '{}' is a URL (autosearch={}).".format(
urlstr, autosearch))
url = urlstr.strip()
qurl = QUrl(urlstr)
if not autosearch: