aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/download_strategy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/download_strategy.rb')
-rw-r--r--Library/Homebrew/download_strategy.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index feb518057..e85661d76 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -303,7 +303,11 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy
# We can't use basename_without_params, because given a URL like
# https://example.com/download.php?file=foo-1.0.tar.gz
# the extension we want is ".tar.gz", not ".php".
- Pathname.new(@url).extname[/[^?]+/]
+ Pathname.new(@url).ascend do |path|
+ ext = path.extname[/[^?]+/]
+ return ext if ext
+ end
+ nil
end
end