From b4a695d5b88f91cbb11bc428f81eda3c63a4f46f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 2 Aug 2015 17:18:59 +0200 Subject: [PATCH] Strip trailing slash when getting path from URL. --- qutebrowser/browser/http.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/http.py b/qutebrowser/browser/http.py index 0b2c74eba..178917790 100644 --- a/qutebrowser/browser/http.py +++ b/qutebrowser/browser/http.py @@ -55,7 +55,9 @@ def parse_content_disposition(reply): is_inline = content_disposition.is_inline() # Then try to get filename from url if not filename: - filename = reply.url().path() + path = reply.url().path() + if path is not None: + filename = path.rstrip('/') # If that fails as well, use a fallback if not filename: filename = 'qutebrowser-download'