diff options
author | Valery Piashchynski <[email protected]> | 2021-03-16 17:05:28 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-03-16 18:23:50 +0300 |
commit | 584f9ad08cfe162f1c9a9e42802e0bd0a2284ea8 (patch) | |
tree | 5b4fd57ff7925c61196c8b3557d5d81ed55ab50e | |
parent | a30d837bbb2d1f5e8744dc25bbe89aab408dee18 (diff) |
🐛 fix issue with strange messages in the http body when max requestv2.0.2-beta.1
reached
Signed-off-by: Valery Piashchynski <[email protected]>
-rw-r--r-- | plugins/http/handler.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/http/handler.go b/plugins/http/handler.go index 11d9b827..b7c6f1fa 100644 --- a/plugins/http/handler.go +++ b/plugins/http/handler.go @@ -106,11 +106,10 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } if size > int64(h.maxRequestSize) { + h.sendEvent(ErrorEvent{Request: r, Error: errors.E(op, errors.Str("request body max size is exceeded")), start: start, elapsed: time.Since(start)}) http.Error(w, errors.E(op, errors.Str("request body max size is exceeded")).Error(), 500) + return } - - h.sendEvent(ErrorEvent{Request: r, Error: errors.E(op, errors.Str("request body max size is exceeded")), start: start, elapsed: time.Since(start)}) - return } } |