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
reviewable/pr18780/r1
James Cammarata 10 years ago
commit 5f1f4ef3fd

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