Merge pull request #2566 from zmwangx/pull-fix-check-bintray-mirror
pull: fix status code check in check_bintray_mirror
This commit is contained in:
commit
59f78361c9
@ -608,7 +608,7 @@ module Homebrew
|
|||||||
def check_bintray_mirror(name, url)
|
def check_bintray_mirror(name, url)
|
||||||
headers = curl_output("--connect-timeout", "15", "--head", url)[0]
|
headers = curl_output("--connect-timeout", "15", "--head", url)[0]
|
||||||
status_code = headers.scan(%r{^HTTP\/.* (\d+)}).last.first
|
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 "The Bintray mirror #{url} is not reachable (HTTP status code #{status_code})."
|
||||||
opoo "Do you need to upload it with `brew mirror #{name}`?"
|
opoo "Do you need to upload it with `brew mirror #{name}`?"
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user