From 7f115c03c6f534be240ee7f2650163ae32f19626 Mon Sep 17 00:00:00 2001 From: herobrauni Date: Tue, 10 Dec 2024 02:03:19 +0100 Subject: [PATCH] feat: change payload for healthchecks to text (#607) --- internal/hook/types/healthchecks.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/internal/hook/types/healthchecks.go b/internal/hook/types/healthchecks.go index ec55dd6b..63a131bc 100644 --- a/internal/hook/types/healthchecks.go +++ b/internal/hook/types/healthchecks.go @@ -3,7 +3,6 @@ package types import ( "bytes" "context" - "encoding/json" "fmt" "reflect" @@ -47,17 +46,7 @@ func (healthchecksHandler) Execute(ctx context.Context, cmd *v1.Hook, vars inter PingUrl += "/log" } - type Message struct { - Text string `json:"text"` - } - - request := Message{ - Text: payload, - } - - requestBytes, _ := json.Marshal(request) - - body, err := hookutil.PostRequest(PingUrl, "application/json", bytes.NewReader(requestBytes)) + body, err := hookutil.PostRequest(PingUrl, "text/plain", bytes.NewBufferString(payload)) if err != nil { return fmt.Errorf("sending healthchecks message to %q: %w", PingUrl, err) }