From 17c3a66265b38084a16b3ebaf057d1f9c8b4f805 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 5 Sep 2018 02:28:35 +0200 Subject: [PATCH] Change regex to match `filename` if header also contains `filename*`. --- Library/Homebrew/download_strategy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index d828e198a5..2bb9c488fe 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -339,7 +339,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy 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 basename = filenames.last || parse_basename(redirect_url)