[patch] HTTP -> HTTPS
parent
6cfaede5a0
commit
c2f740ab38
6
nvm.sh
6
nvm.sh
|
@ -101,15 +101,15 @@ nvm_get_latest() {
|
||||||
if nvm_curl_use_compression; then
|
if nvm_curl_use_compression; then
|
||||||
CURL_COMPRESSED_FLAG="--compressed"
|
CURL_COMPRESSED_FLAG="--compressed"
|
||||||
fi
|
fi
|
||||||
NVM_LATEST_URL="$(curl ${CURL_COMPRESSED_FLAG:-} -q -w "%{url_effective}\\n" -L -s -S http://latest.nvm.sh -o /dev/null)"
|
NVM_LATEST_URL="$(curl ${CURL_COMPRESSED_FLAG:-} -q -w "%{url_effective}\\n" -L -s -S https://latest.nvm.sh -o /dev/null)"
|
||||||
elif nvm_has "wget"; then
|
elif nvm_has "wget"; then
|
||||||
NVM_LATEST_URL="$(wget -q http://latest.nvm.sh --server-response -O /dev/null 2>&1 | command awk '/^ Location: /{DEST=$2} END{ print DEST }')"
|
NVM_LATEST_URL="$(wget -q https://latest.nvm.sh --server-response -O /dev/null 2>&1 | command awk '/^ Location: /{DEST=$2} END{ print DEST }')"
|
||||||
else
|
else
|
||||||
nvm_err 'nvm needs curl or wget to proceed.'
|
nvm_err 'nvm needs curl or wget to proceed.'
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if [ -z "${NVM_LATEST_URL}" ]; then
|
if [ -z "${NVM_LATEST_URL}" ]; then
|
||||||
nvm_err "http://latest.nvm.sh did not redirect to the latest release on GitHub"
|
nvm_err "https://latest.nvm.sh did not redirect to the latest release on GitHub"
|
||||||
return 2
|
return 2
|
||||||
fi
|
fi
|
||||||
nvm_echo "${NVM_LATEST_URL##*/}"
|
nvm_echo "${NVM_LATEST_URL##*/}"
|
||||||
|
|
|
@ -10,8 +10,8 @@ cleanup() {
|
||||||
|
|
||||||
EXPECTED_VERSION="v12.3.456"
|
EXPECTED_VERSION="v12.3.456"
|
||||||
URL="https://github.com/nvm-sh/nvm/releases/tag/$EXPECTED_VERSION"
|
URL="https://github.com/nvm-sh/nvm/releases/tag/$EXPECTED_VERSION"
|
||||||
EXPECTED_CURL_ARGS="--compressed -q -w %{url_effective}\n -L -s -S http://latest.nvm.sh -o /dev/null"
|
EXPECTED_CURL_ARGS="--compressed -q -w %{url_effective}\n -L -s -S https://latest.nvm.sh -o /dev/null"
|
||||||
EXPECTED_WGET_ARGS="-q http://latest.nvm.sh --server-response -O /dev/null"
|
EXPECTED_WGET_ARGS="-q https://latest.nvm.sh --server-response -O /dev/null"
|
||||||
|
|
||||||
curl() {
|
curl() {
|
||||||
if [ $# -eq 1 ] && [ "$1" = "-V" ]; then
|
if [ $# -eq 1 ] && [ "$1" = "-V" ]; then
|
||||||
|
|
|
@ -17,7 +17,7 @@ wget() {
|
||||||
|
|
||||||
OUTPUT="$(nvm_get_latest 2>&1)"
|
OUTPUT="$(nvm_get_latest 2>&1)"
|
||||||
EXIT_CODE="$(nvm_get_latest >/dev/null 2>&1 ; echo $?)"
|
EXIT_CODE="$(nvm_get_latest >/dev/null 2>&1 ; echo $?)"
|
||||||
[ "_$OUTPUT" = "_http://latest.nvm.sh did not redirect to the latest release on GitHub" ] \
|
[ "_$OUTPUT" = "_https://latest.nvm.sh did not redirect to the latest release on GitHub" ] \
|
||||||
|| die "failed redirect did not report correct error message, got '$OUTPUT'"
|
|| die "failed redirect did not report correct error message, got '$OUTPUT'"
|
||||||
[ "_$EXIT_CODE" = "_2" ] \
|
[ "_$EXIT_CODE" = "_2" ] \
|
||||||
|| die "failed redirect did not exit with code 2, got $EXIT_CODE"
|
|| die "failed redirect did not exit with code 2, got $EXIT_CODE"
|
||||||
|
|
Loading…
Reference in New Issue