diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index 2498ea7f6..518012f10 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -141,10 +141,16 @@ def data_for_url(url): # A url like "qute:foo" is split as "scheme:path", not "scheme:host". log.misc.debug("url: {}, path: {}, host {}".format( url.toDisplayString(), path, host)) - if path and not host: + if not path or not host: new_url = QUrl() new_url.setScheme('qute') - new_url.setHost(path) + # When path is absent, e.g. qute://help (with no trailing slash) + if host: + new_url.setHost(host) + # When host is absent, e.g. qute:help + else: + new_url.setHost(path) + new_url.setPath('/') if new_url.host(): # path was a valid host raise Redirect(new_url)