urlmatch: Postpone checking scheme

This commit is contained in:
Florian Bruhin 2018-02-15 18:11:42 +01:00
parent 5627a63265
commit 41b7ac27d7

View File

@ -242,13 +242,11 @@ class UrlPattern:
"""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
if self._match_all:
return True
if not self._matches_scheme(qurl.scheme()):
return False
# FIXME ignore for file:// like Chromium?
if not self._matches_host(qurl.host()):
return False