Skip to content
Snippets Groups Projects
Unverified Commit 7a75de7c authored by Zhiming Wang's avatar Zhiming Wang
Browse files

pull: fix status code check in check_bintray_mirror

The status code of the last redirect should be 2xx to be deemed successful.
parent b067700f
No related branches found
No related tags found
No related merge requests found
......@@ -608,7 +608,7 @@ module Homebrew
def check_bintray_mirror(name, url)
headers = curl_output("--connect-timeout", "15", "--head", url)[0]
status_code = headers.scan(%r{^HTTP\/.* (\d+)}).last.first
return if status_code.start_with?("3")
return if status_code.start_with?("2")
opoo "The Bintray mirror #{url} is not reachable (HTTP status code #{status_code})."
opoo "Do you need to upload it with `brew mirror #{name}`?"
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment