]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
request_failure hook: added http response headers as new parameter
authorLukas Schauer <lukas@schauer.so>
Tue, 6 Feb 2018 22:33:02 +0000 (23:33 +0100)
committerLukas Schauer <lukas@schauer.so>
Tue, 6 Feb 2018 22:33:28 +0000 (23:33 +0100)
dehydrated
docs/examples/hook.sh

index 09632caf10d5af9071f2ca5f83627cc14b6b062f..b2e3d2d81a71aadfc344982829c797f425ccb779 100755 (executable)
@@ -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}"
index b25c74d844f964d8c1e724bd08f4619c1f05ce2b..61bcc1bda057035e892848858a09acfef4a87dd6 100755 (executable)
@@ -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