浏览代码

add timeout for _getRepoHash
https://github.com/acmesh-official/acme.sh/issues/5200

neil 1 年之前
父节点
当前提交
d81fc155cb
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      acme.sh

+ 1 - 1
acme.sh

@@ -7082,7 +7082,7 @@ _getRepoHash() {
   _hash_path=$1
   _hash_path=$1
   shift
   shift
   _hash_url="${PROJECT_API:-https://api.github.com/repos/acmesh-official}/$PROJECT_NAME/git/refs/$_hash_path"
   _hash_url="${PROJECT_API:-https://api.github.com/repos/acmesh-official}/$PROJECT_NAME/git/refs/$_hash_path"
-  _get $_hash_url | tr -d "\r\n" | tr '{},' '\n\n\n' | grep '"sha":' | cut -d '"' -f 4
+  _get "$_hash_url" "" 30 | tr -d "\r\n" | tr '{},' '\n\n\n' | grep '"sha":' | cut -d '"' -f 4
 }
 }
 
 
 _getUpgradeHash() {
 _getUpgradeHash() {