Skip to content

Commit b6648d9

Browse files
authored
Merge pull request #108 from BarryCarlyon/patch-1
Report on the content type of the remote API when event verify-subscription-ing
2 parents f5e790a + d3c85bd commit b6648d9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/events/verify/subscription_verify.go

+6
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ func VerifyWebhookSubscription(p VerifyParameters) (VerifyResponse, error) {
9494
r.IsChallengeValid = false
9595
}
9696

97+
if resp.Header.Get("Content-Type") == "text/plain" {
98+
color.New().Add(color.FgGreen).Println(fmt.Sprintf(`✔ Valid content-type header. Received type %v`, resp.Header.Get("Content-Type")))
99+
} else {
100+
color.New().Add(color.FgRed).Println(fmt.Sprintf(`✗ Invalid content-type header. Received type %v`, resp.Header.Get("Content-Type")))
101+
}
102+
97103
if resp.StatusCode >= 200 && resp.StatusCode <= 299 {
98104
color.New().Add(color.FgGreen).Println(fmt.Sprintf(`✔ Valid status code. Received status %v`, resp.StatusCode))
99105
r.IsStatusValid = true

0 commit comments

Comments
 (0)