Browse Source

fix get the latest release tag error

https://github.com/v2ray/v2ray-core/issues/2373
Kslr 5 years ago
parent
commit
bab1c33de3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      release/install-release.sh

+ 1 - 1
release/install-release.sh

@@ -255,7 +255,7 @@ getVersion(){
         RETVAL=$?
         RETVAL=$?
         CUR_VER="$(normalizeVersion "$(echo "$VER" | head -n 1 | cut -d " " -f2)")"
         CUR_VER="$(normalizeVersion "$(echo "$VER" | head -n 1 | cut -d " " -f2)")"
         TAG_URL="https://api.github.com/repos/v2ray/v2ray-core/releases/latest"
         TAG_URL="https://api.github.com/repos/v2ray/v2ray-core/releases/latest"
-        NEW_VER="$(normalizeVersion "$(curl ${PROXY} -s "${TAG_URL}" --connect-timeout 10| grep 'tag_name' | cut -d\" -f4)")"
+        NEW_VER="$(normalizeVersion "$(curl ${PROXY} -H "Accept: application/json" -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0" -s "${TAG_URL}" --connect-timeout 10| grep 'tag_name' | cut -d\" -f4)")"
 
 
         if [[ $? -ne 0 ]] || [[ $NEW_VER == "" ]]; then
         if [[ $? -ne 0 ]] || [[ $NEW_VER == "" ]]; then
             colorEcho ${RED} "Failed to fetch release information. Please check your network or try again."
             colorEcho ${RED} "Failed to fetch release information. Please check your network or try again."