From b0742db4fa4b08422aac520fb5638aae9700e899 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 21 Oct 2018 05:54:18 +0200 Subject: [PATCH] Support `Content-Disposition: inline`. --- Library/Homebrew/download_strategy.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 4afcc16032..bddc679e36 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -352,8 +352,9 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy end end - filenames = lines.map { |line| line[/^Content\-Disposition:\s*attachment;\s*filename=(["']?)([^;]+)\1/i, 2] } - .compact + filenames = + lines.map { |line| line[/^Content\-Disposition:\s*(?:inline|attachment);\s*filename=(["']?)([^;]+)\1/i, 2] } + .compact basename = filenames.last || parse_basename(redirect_url)