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
This commit is contained in:
commit
795eaccecb
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue