From b2385870afcffe105b4b97c576bfe3e7c225825d Mon Sep 17 00:00:00 2001 From: George Yoshida Date: Sat, 23 Aug 2014 12:10:45 +0900 Subject: [PATCH] For content-disposition response header field, try to parse filename parameter even if it's not quoted. --- library/network/get_url | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/network/get_url b/library/network/get_url index e2384e4ebd5..5c5faa4624a 100644 --- a/library/network/get_url +++ b/library/network/get_url @@ -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: