mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-06-08 07:12:16 +08:00
[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:
2
nvm.sh
2
nvm.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user