[Fix] nvm_download: send a well-formed Authorization header on the wget path

The wget path passed `NVM_AUTH_HEADER` as the raw header line
(e.g. `--header "Bearer secret-token"`),
omitting the `Authorization:` header name that the curl path includes.
Per the documented usage
(`NVM_AUTH_HEADER="Bearer secret-token"`) the value is the credential,
so wget was sending a malformed header.
Prefix it with `Authorization: ` to match the curl path.
This commit is contained in:
Jordan Harband
2026-06-02 17:40:50 -07:00
parent 84079dbff3
commit d264b796a3
2 changed files with 44 additions and 1 deletions

2
nvm.sh
View File

@@ -151,7 +151,7 @@ nvm_download() {
if [ -n "${NVM_AUTH_HEADER:-}" ]; then
sanitized_header=$(nvm_sanitize_auth_header "${NVM_AUTH_HEADER}")
ARGS="${ARGS} --header \"${sanitized_header}\""
ARGS="${ARGS} --header \"Authorization: ${sanitized_header}\""
fi
# shellcheck disable=SC2086
eval wget $ARGS