Merge pull request #8725 from quiver/fix-get_url-content-disposition

[get_url module]parse content-disposition filename parameter even if it's not quoted
pull/8743/merge
James Cammarata 10 years ago
commit 795eaccecb

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