mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
For content-disposition response header field, try to parse filename parameter even if it's not quoted.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user