From c2f740ab384a16f6ce8b50b2d545881beeedefe0 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 18 Jan 2022 12:49:57 -0800 Subject: [PATCH] [patch] HTTP -> HTTPS --- nvm.sh | 6 +++--- test/slow/nvm_get_latest/nvm_get_latest | 4 ++-- test/slow/nvm_get_latest/nvm_get_latest failed redirect | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nvm.sh b/nvm.sh index bb61a71..e769fa5 100644 --- a/nvm.sh +++ b/nvm.sh @@ -101,15 +101,15 @@ nvm_get_latest() { if nvm_curl_use_compression; then CURL_COMPRESSED_FLAG="--compressed" 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 - 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 nvm_err 'nvm needs curl or wget to proceed.' return 1 fi 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 fi nvm_echo "${NVM_LATEST_URL##*/}" diff --git a/test/slow/nvm_get_latest/nvm_get_latest b/test/slow/nvm_get_latest/nvm_get_latest index 5311360..32b85e7 100755 --- a/test/slow/nvm_get_latest/nvm_get_latest +++ b/test/slow/nvm_get_latest/nvm_get_latest @@ -10,8 +10,8 @@ cleanup() { EXPECTED_VERSION="v12.3.456" 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_WGET_ARGS="-q http://latest.nvm.sh --server-response -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 https://latest.nvm.sh --server-response -O /dev/null" curl() { if [ $# -eq 1 ] && [ "$1" = "-V" ]; then diff --git a/test/slow/nvm_get_latest/nvm_get_latest failed redirect b/test/slow/nvm_get_latest/nvm_get_latest failed redirect index 97534e9..2548b06 100755 --- a/test/slow/nvm_get_latest/nvm_get_latest failed redirect +++ b/test/slow/nvm_get_latest/nvm_get_latest failed redirect @@ -17,7 +17,7 @@ wget() { OUTPUT="$(nvm_get_latest 2>&1)" 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'" [ "_$EXIT_CODE" = "_2" ] \ || die "failed redirect did not exit with code 2, got $EXIT_CODE"