diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index bf2215b273..fe432c56ca 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -5,6 +5,14 @@ require "utils/github" require "tmpdir" require "bintray" +class CurlNoResumeDownloadStrategy < CurlDownloadStrategy + private + + def _fetch(url:, resolved_url:) + curl("--location", "--remote-time", "--create-dirs", "--output", temporary_path, resolved_url) + end +end + module Homebrew module_function @@ -192,7 +200,9 @@ module Homebrew if Homebrew.args.dry_run? puts "Upload bottles described by these JSON files to Bintray:\n #{Dir["*.json"].join("\n ")}" else - bintray.upload_bottle_json Dir["*.json"], publish_package: !args.no_publish? + bintray.upload_bottle_json Dir["*.json"], + publish_package: !args.no_publish?, + strategy: CurlNoResumeDownloadStrategy end end end diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index acce9e5bde..33d60a8cb3 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -435,7 +435,8 @@ module GitHub scopes: CREATE_ISSUE_FORK_OR_PR_SCOPES) end - def fetch_artifact(user, repo, pr, dir, workflow_id: "tests.yml", artifact_name: "bottles") + def fetch_artifact(user, repo, pr, dir, + workflow_id: "tests.yml", artifact_name: "bottles", strategy: CurlDownloadStrategy) scopes = CREATE_ISSUE_FORK_OR_PR_SCOPES base_url = "#{API_URL}/repos/#{user}/#{repo}" pr_payload = open_api("#{base_url}/pulls/#{pr}", scopes: scopes) @@ -496,7 +497,7 @@ module GitHub FileUtils.chdir dir do curl_args[:cache] = Pathname.new(dir) curl_args[:secrets] = [token] - downloader = CurlDownloadStrategy.new(artifact_url, "artifact", pr, **curl_args) + downloader = strategy.new(artifact_url, "artifact", pr, **curl_args) downloader.fetch downloader.stage end