mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-12 00:24:45 +00:00
override content type header when returning error message
This commit is contained in:
parent
cc0d9b2cba
commit
c53596df59
1 changed files with 1 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue