From c53596df5990fe8003d786856add38b25a8574c3 Mon Sep 17 00:00:00 2001 From: Adnan Hajdarevic Date: Thu, 29 Sep 2016 20:08:47 +0200 Subject: [PATCH] override content type header when returning error message --- webhook.go | 1 + 1 file changed, 1 insertion(+) diff --git a/webhook.go b/webhook.go index 1ff5a6e..36a303b 100644 --- a/webhook.go +++ b/webhook.go @@ -225,6 +225,7 @@ func hookHandler(w http.ResponseWriter, r *http.Request) { response, err := handleHook(matchedHook, &headers, &query, &payload, &body) if err != nil { + w.Header().Set("Content-Type", "text/plain; charset=utf-8") w.WriteHeader(http.StatusInternalServerError) fmt.Fprintf(w, "Error occurred while executing the hook's command. Please check your logs for more details.\n") } else {