浏览代码

Issue 3968: Fix missing api password encoding.

Marcel Schlegel 4 月之前
父节点
当前提交
28687ad7c7
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      dnsapi/dns_cloudns.sh

+ 3 - 2
dnsapi/dns_cloudns.sh

@@ -197,10 +197,11 @@ _dns_cloudns_http_api_call() {
     auth_user="auth-id=$CLOUDNS_AUTH_ID"
   fi
 
+  encoded_password=$(echo "$CLOUDNS_AUTH_PASSWORD" | tr -d "\n\r" | _url_encode)
   if [ -z "$2" ]; then
-    data="$auth_user&auth-password=$CLOUDNS_AUTH_PASSWORD"
+    data="$auth_user&auth-password=$encoded_password"
   else
-    data="$auth_user&auth-password=$CLOUDNS_AUTH_PASSWORD&$2"
+    data="$auth_user&auth-password=$encoded_password&$2"
   fi
 
   response="$(_get "$CLOUDNS_API/$method?$data")"