mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 15:22:47 +01:00
24 lines
509 B
Go
24 lines
509 B
Go
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
|
|
}
|