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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user