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
pull/304/head
i3dx 2024-09-29 20:07:47 +08:00 committed by GitHub
parent b3cbf91a19
commit 4d1d1758a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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