From: Lukas Schauer Date: Tue, 6 Feb 2018 22:33:02 +0000 (+0100) Subject: request_failure hook: added http response headers as new parameter X-Git-Tag: v0.6.0~12 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2eedd69ee9420db11cd9b542a37ca2f2266adb7e;p=thirdparty%2Fdehydrated.git request_failure hook: added http response headers as new parameter --- diff --git a/dehydrated b/dehydrated index 09632ca..b2e3d2d 100755 --- a/dehydrated +++ b/dehydrated @@ -522,7 +522,8 @@ http_request() { # An exclusive hook for the {1}-request error might be useful (e.g., for sending an e-mail to admins) if [[ -n "${HOOK}" ]] && [[ "${HOOK_CHAIN}" != "yes" ]]; then errtxt="$(cat ${tempcont})" - "${HOOK}" "request_failure" "${statuscode}" "${errtxt}" "${1}" + errheaders="$(cat ${tempheaders})" + "${HOOK}" "request_failure" "${statuscode}" "${errtxt}" "${1}" "${errheaders}" fi rm -f "${tempcont}" diff --git a/docs/examples/hook.sh b/docs/examples/hook.sh index b25c74d..61bcc1b 100755 --- a/docs/examples/hook.sh +++ b/docs/examples/hook.sh @@ -102,7 +102,7 @@ invalid_challenge() { } request_failure() { - local STATUSCODE="${1}" REASON="${2}" REQTYPE="${3}" + local STATUSCODE="${1}" REASON="${2}" REQTYPE="${3}" HEADERS="${4}" # This hook is called when an HTTP request fails (e.g., when the ACME # server is busy, returns an error, etc). It will be called upon any