diff --git a/developer/bin/cask-switch-https b/developer/bin/cask-switch-https index e24c1ec9ac..d958f96303 100755 --- a/developer/bin/cask-switch-https +++ b/developer/bin/cask-switch-https @@ -66,7 +66,7 @@ check_url_for_https() { # check if the URL sends a 200 HTTP code, else abort browser_headers="User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36" - cask_status=$(curl --silent ${verbose_option}--head --max-time 10 --proto =https --location --header "${browser_headers}" "${cask_url}") + cask_status=$(curl --silent ${verbose_option} --head --max-time 10 --proto =https --location --header "${browser_headers}" --write-out '%{http_code}' "${cask_url}" -o '/dev/null') exit_code=$? if [[ exit_code -ne 0 ]]; then @@ -74,8 +74,6 @@ check_url_for_https() { return 1 fi - cask_status=$(echo ${cask_status} | grep '^HTTP' | tail -1 | perl -pe 's|.* (\d{3}) .*|\1|') - if [[ "${cask_status}" != '200' ]]; then if [[ -z "${cask_status}" ]]; then echo "URL ${cask_url} is not reachable!"