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

reviewable/pr18780/r1
George Yoshida 10 years ago
parent f0a552c060
commit cd0dae890c

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

Loading…
Cancel
Save