summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2016-08-01 17:18:14 +0200
committerFlorian Bruhin <git@the-compiler.org>2016-08-02 10:51:54 +0200
commit776a16bf658636ec1e50e6389f9e253c1e4ea76a (patch)
tree661a626c2d304a2422a3dba446020cb208c407e8
parent225c86045246f1e8e21bd774a7ffce0ce3420bd1 (diff)
downloadqutebrowser-776a16bf658636ec1e50e6389f9e253c1e4ea76a.tar.gz
qutebrowser-776a16bf658636ec1e50e6389f9e253c1e4ea76a.zip
Fix crash when opening http://foo%40bar@baz
-rw-r--r--qutebrowser/browser/webkit/history.py4
-rw-r--r--tests/end2end/features/history.feature9
2 files changed, 13 insertions, 0 deletions
diff --git a/qutebrowser/browser/webkit/history.py b/qutebrowser/browser/webkit/history.py
index e4774e499..3ede42cc7 100644
--- a/qutebrowser/browser/webkit/history.py
+++ b/qutebrowser/browser/webkit/history.py
@@ -295,6 +295,10 @@ class WebHistory(QObject):
"""
if config.get('general', 'private-browsing'):
return
+ if not url.isValid():
+ log.misc.warning("Ignoring invalid URL being added to history")
+ return
+
if atime is None:
atime = time.time()
entry = Entry(atime, url, title, redirect=redirect)
diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature
index fab89f1fc..1cd680d7e 100644
--- a/tests/end2end/features/history.feature
+++ b/tests/end2end/features/history.feature
@@ -51,3 +51,12 @@ Feature: Page history
When I open data/title.html
And I run :history-clear
Then the history file should be empty
+
+ ## Bugs
+
+ Scenario: Opening a valid URL which turns out invalid
+ When I set general -> auto-search to true
+ And I run :open http://foo%40bar@baz
+ Then "QFSFileEngine::open: No file name specified" should be logged
+ And "Error while loading : Host not found" should be logged
+ And "Ignoring invalid URL being added to history" should be logged