urlmatch: Make sure URLs are valid

This commit is contained in:
Florian Bruhin 2018-02-15 17:26:06 +01:00
parent 0a10a4f751
commit a2836ba945

View File

@ -30,7 +30,7 @@ import fnmatch
import contextlib
import urllib.parse
from qutebrowser.utils import utils
from qutebrowser.utils import utils, qtutils
class ParseError(Exception):
@ -236,6 +236,8 @@ class UrlPattern:
def matches(self, qurl):
"""Check if the pattern matches the given QUrl."""
qtutils.ensure_valid(qurl)
# FIXME do we need to check this early?
if not self._matches_scheme(qurl.scheme()):
return False