Strip trailing slash when getting path from URL.

This commit is contained in:
Florian Bruhin 2015-08-02 17:18:59 +02:00
parent 359b886ba0
commit b4a695d5b8

View File

@ -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'