fixes issue #3161
This commit is contained in:
parent
43aa7423ab
commit
aab7496916
@ -141,10 +141,16 @@ def data_for_url(url):
|
|||||||
# A url like "qute:foo" is split as "scheme:path", not "scheme:host".
|
# A url like "qute:foo" is split as "scheme:path", not "scheme:host".
|
||||||
log.misc.debug("url: {}, path: {}, host {}".format(
|
log.misc.debug("url: {}, path: {}, host {}".format(
|
||||||
url.toDisplayString(), path, host))
|
url.toDisplayString(), path, host))
|
||||||
if path and not host:
|
if not path or not host:
|
||||||
new_url = QUrl()
|
new_url = QUrl()
|
||||||
new_url.setScheme('qute')
|
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('/')
|
new_url.setPath('/')
|
||||||
if new_url.host(): # path was a valid host
|
if new_url.host(): # path was a valid host
|
||||||
raise Redirect(new_url)
|
raise Redirect(new_url)
|
||||||
|
Loading…
Reference in New Issue
Block a user