fix: prevent spurious stack trace with misbehaving clients

See 9997545a86
and the previous commit.

Co-authored-by: César Gallego Rodríguez <gallego.cesar@gmail.com>
This commit is contained in:
pancho horrillo
2020-05-11 15:57:25 +02:00
parent 13adcc37b6
commit 975aea88ae
+1 -3
View File
@@ -42,9 +42,7 @@ func getRequestBody(w http.ResponseWriter, r *http.Request, h *model.Handler) {
if n == 0 {
httperror.ErrorJSON(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
} else {
// Only way to abort current connection as of go 1.13
// https://github.com/golang/go/issues/16542
panic("Truncated body")
panic(http.ErrAbortHandler)
}
}
}