Change regex to match filename if header also contains filename*.

This commit is contained in:
Markus Reiter 2018-09-05 02:28:35 +02:00
parent eccbc4ea4b
commit 17c3a66265

View File

@ -339,7 +339,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
end end
end end
filenames = lines.map { |line| line[/^Content\-Disposition:\s*attachment;\s*filename=(["']?)(.+)\1$/i, 2] } filenames = lines.map { |line| line[/^Content\-Disposition:\s*attachment;\s*filename=(["']?)([^;]+)\1/i, 2] }
.compact .compact
basename = filenames.last || parse_basename(redirect_url) basename = filenames.last || parse_basename(redirect_url)