mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2026-01-26 16:04:02 +01:00
feat: add reactions (#1074)
This commit is contained in:
23
reaction/trigger/webhook/request.go
Normal file
23
reaction/trigger/webhook/request.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package webhook
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type Request struct {
|
||||
Method string `json:"method"`
|
||||
Path string `json:"path"`
|
||||
Headers http.Header `json:"headers"`
|
||||
Query url.Values `json:"query"`
|
||||
Body string `json:"body"`
|
||||
IsBase64Encoded bool `json:"isBase64Encoded"`
|
||||
}
|
||||
|
||||
// isJSON checks if the data is JSON.
|
||||
func isJSON(data []byte) bool {
|
||||
var msg json.RawMessage
|
||||
|
||||
return json.Unmarshal(data, &msg) == nil
|
||||
}
|
||||
Reference in New Issue
Block a user