diff --git a/qutebrowser/test/utils/test_url.py b/qutebrowser/test/utils/test_url.py index 2dd858f78..e960b4bc4 100644 --- a/qutebrowser/test/utils/test_url.py +++ b/qutebrowser/test/utils/test_url.py @@ -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', diff --git a/qutebrowser/utils/urlutils.py b/qutebrowser/utils/urlutils.py index 21ffb6a30..5019f8e22 100644 --- a/qutebrowser/utils/urlutils.py +++ b/qutebrowser/utils/urlutils.py @@ -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: