From 44b388c9fd07060ee4ff4e5a4361ae5a88fce71b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Tue, 5 Nov 2024 07:44:09 -0300 Subject: [PATCH] install-from-binstall-release: Add user-agent into curl (#1956) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It appears that github API now enforces the user-agent Signed-off-by: Patrick José Pereira --- install-from-binstall-release.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index d87b29eb..fa4f8222 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -11,7 +11,7 @@ base_url="https://github.com/cargo-bins/cargo-binstall/releases/${BINSTALL_VERSI os="$(uname -s)" if [ "$os" == "Darwin" ]; then url="${base_url}universal-apple-darwin.zip" - curl -LO --proto '=https' --tlsv1.2 -sSf "$url" + curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -LO --proto '=https' --tlsv1.2 -sSf "$url" unzip cargo-binstall-universal-apple-darwin.zip elif [ "$os" == "Linux" ]; then machine="$(uname -m)" @@ -24,12 +24,12 @@ elif [ "$os" == "Linux" ]; then fi url="${base_url}${target}.tgz" - curl -L --proto '=https' --tlsv1.2 -sSf "$url" | tar -xvzf - + curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -L --proto '=https' --tlsv1.2 -sSf "$url" | tar -xvzf - elif [ "${OS-}" = "Windows_NT" ]; then machine="$(uname -m)" target="${machine}-pc-windows-msvc" url="${base_url}${target}.zip" - curl -LO --proto '=https' --tlsv1.2 -sSf "$url" + curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -LO --proto '=https' --tlsv1.2 -sSf "$url" unzip "cargo-binstall-${target}.zip" else echo "Unsupported OS ${os}"