For content-disposition response header field, try to parse filename parameter even if it's not quoted.

This commit is contained in:
George Yoshida 2014-08-23 12:10:45 +09:00
parent a419ffdf41
commit b2385870af

View file

@ -169,7 +169,7 @@ def extract_filename_from_headers(headers):
Looks for the content-disposition header and applies a regex.
Returns the filename if successful, else None."""
cont_disp_regex = 'attachment; ?filename="(.+)"'
cont_disp_regex = 'attachment; ?filename="?([^"]+)'
res = None
if 'content-disposition' in headers: