From 4d1d1758a04952383634bf2b793ceaac1db63b6c Mon Sep 17 00:00:00 2001 From: i3dx Date: Sun, 29 Sep 2024 20:07:47 +0800 Subject: [PATCH] Update install-release.sh "Github API is responding with a 403" HTTP Headers, such as User-Agent, can be set in the options object. In the example below, we call the github API to find out the number of stars and forks for the request repository. This requires a custom User-Agent header as well as https. https://github.com/request/request#custom-http-headers --- install-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-release.sh b/install-release.sh index 2164215..516ccdd 100644 --- a/install-release.sh +++ b/install-release.sh @@ -243,7 +243,7 @@ get_version() { fi # Get V2Ray release version number TMP_FILE="$(mktemp)" - if ! curl -x "${PROXY}" -sS -i -H "Accept: application/vnd.github.v3+json" -o "$TMP_FILE" 'https://api.github.com/repos/v2fly/v2ray-core/releases/latest'; then + if ! curl -x "${PROXY}" -sS -i -H "Accept: application/vnd.github.v3+json" -H "User-Agent: request" -o "$TMP_FILE" 'https://api.github.com/repos/v2fly/v2ray-core/releases/latest'; then "rm" "$TMP_FILE" echo 'error: Failed to get release list, please check your network.' exit 1