Skip to content

Commit

Permalink
feat: change payload for healthchecks to text (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
herobrauni authored Dec 10, 2024
1 parent b1b7fb9 commit a1e3a70
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions internal/hook/types/healthchecks.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package types
import (
"bytes"
"context"
"encoding/json"
"fmt"
"reflect"

Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit a1e3a70

Please sign in to comment.