Browse Source

fix _get

pull/3441/head
Yang Liu 4 years ago
parent
commit
2229047afd
  1. 2
      acme.sh
  2. 8
      dnsapi/dns_ali.sh

2
acme.sh

@ -1942,7 +1942,7 @@ _get() {
fi
_debug "_CURL" "$_CURL"
if [ "$onlyheader" ]; then
$_CURL -X GET -I --user-agent "$USER_AGENT" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" "$url"
$_CURL -I --user-agent "$USER_AGENT" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" "$url"
else
$_CURL --user-agent "$USER_AGENT" -H "$_H1" -H "$_H2" -H "$_H3" -H "$_H4" -H "$_H5" "$url"
fi

8
dnsapi/dns_ali.sh

@ -87,8 +87,12 @@ _get_root() {
_use_instance_role() {
_url="http://100.100.100.200/latest/meta-data/ram/security-credentials/"
_debug "_url" "$_url"
if ! _get "$_url" true 1 | _head_n 1 | grep -Fq 200; then
_debug "Unable to fetch IAM role from instance metadata"
# **Do Not** set the parameter `onlyheadr` for _get, it will
# send a HEAD request instead of GET. And alicloud
# mata url not allow HEAD request.
if _get "$_url" "" 1 | grep '404 - Not Found' > /dev/null; then
_debug "Unable to fetch RAM role from instance metadata"
return 1
fi
_ali_instance_role=$(_get "$_url" "" 1)

Loading…
Cancel
Save