From aab749691649c18eda87d96ba665a1a67ba89861 Mon Sep 17 00:00:00 2001 From: dwagle Date: Mon, 30 Oct 2017 17:09:45 +0545 Subject: [PATCH] fixes issue #3161 --- qutebrowser/browser/qutescheme.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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)