From cbe2440cda71312dc7ba6c4da6abefc856f9539b Mon Sep 17 00:00:00 2001 From: Adnan Hajdarevic Date: Sat, 6 Jun 2015 14:25:32 +0200 Subject: [PATCH] add entire query and headers as well --- hook/hook.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/hook/hook.go b/hook/hook.go index 3cb5b58..16f4a47 100644 --- a/hook/hook.go +++ b/hook/hook.go @@ -21,6 +21,8 @@ const ( SourcePayload string = "payload" SourceString string = "string" SourceEntirePayload string = "entire-payload" + SourceEntireQuery string = "entire-query" + SourceEntireHeaders string = "entire-headers" ) // CheckPayloadSignature calculates and verifies SHA1 signature of the given payload @@ -159,6 +161,22 @@ func (ha *Argument) Get(headers, query, payload *map[string]interface{}) (string return "", false } + return string(r), true + case SourceEntireHeaders: + r, err := json.Marshal(headers) + + if err != nil { + return "", false + } + + return string(r), true + case SourceEntireQuery: + r, err := json.Marshal(query) + + if err != nil { + return "", false + } + return string(r), true }