mirror of
https://github.com/adnanh/webhook.git
synced 2026-07-26 17:00:45 +08:00
add entire query and headers as well
This commit is contained in:
@@ -21,6 +21,8 @@ const (
|
|||||||
SourcePayload string = "payload"
|
SourcePayload string = "payload"
|
||||||
SourceString string = "string"
|
SourceString string = "string"
|
||||||
SourceEntirePayload string = "entire-payload"
|
SourceEntirePayload string = "entire-payload"
|
||||||
|
SourceEntireQuery string = "entire-query"
|
||||||
|
SourceEntireHeaders string = "entire-headers"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CheckPayloadSignature calculates and verifies SHA1 signature of the given payload
|
// 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 "", 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
|
return string(r), true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user