diff options
| -rw-r--r-- | handler.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -28,11 +28,14 @@ func WebhookHandler(w http.ResponseWriter, r *http.Request) { err := decoder.Decode(&hook) if err != nil { + var body string content, cError := ioutil.ReadAll(r.Body) if err != nil { log.Println("Can't read r.Body.", cError) + body = "Message not readable." + } else { + body = string(content) } - body := string(content) log.Print("Wrong JSON.", err, "Original message: "+body) |
