Permalink
Browse files

gpodder.download: Ignore non-ASCII content-disposition header (bug 2059)

  • Loading branch information...
1 parent 1e2cc73 commit 2fab3577e39051dacd1e4ed3090ea166170dc694 @thp thp committed Jan 15, 2016
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/gpodder/download.py
View
@@ -820,8 +820,13 @@ def run(self):
real_url, os.path.basename(self.filename))
# Look at the Content-disposition header; use if if available
- disposition_filename = get_header_param(headers, \
- 'filename', 'content-disposition')
+ disposition_filename = get_header_param(headers, 'filename', 'content-disposition')
+
+ try:
+ disposition_filename.decode('ascii')
+ except:
+ logger.warn('Content-disposition header contains non-ASCII characters - ignoring')
+ disposition_filename = None
# Some servers do send the content-disposition header, but provide
# an empty filename, resulting in an empty string here (bug 1440)

0 comments on commit 2fab357

Please sign in to comment.