From 656986153b6be30ed5519a31ab7891253f209da6 Mon Sep 17 00:00:00 2001 From: Claudia Date: Tue, 13 Mar 2018 16:41:47 +0100 Subject: [PATCH] Stop file ext detection at query param boundaries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit improves Homebrew’s extension detector in `cask/lib/hbc/download_strategy.rb` a bit so that it won’t cross individual URL query param boundaries any longer: ``` def ext Pathname.new(@url).extname[/[^?&]+/] end ``` --- Library/Homebrew/cask/lib/hbc/download_strategy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/lib/hbc/download_strategy.rb b/Library/Homebrew/cask/lib/hbc/download_strategy.rb index 245ad4adeb..c6f4b78543 100644 --- a/Library/Homebrew/cask/lib/hbc/download_strategy.rb +++ b/Library/Homebrew/cask/lib/hbc/download_strategy.rb @@ -154,7 +154,7 @@ module Hbc end def ext - Pathname.new(@url).extname[/[^?]+/] + Pathname.new(@url).extname[/[^?&]+/] end end