summaryrefslogtreecommitdiff
path: root/plugins/http
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-03-16 17:05:28 +0300
committerValery Piashchynski <[email protected]>2021-03-16 17:05:28 +0300
commite5508fa1ae3a068913b54fa7aaef2a47bca91f76 (patch)
tree386fd7c985c464170afe6523dc5e57d6a85a1616 /plugins/http
parenteec190334e03012e9dfc3ba83c106d8b3974b238 (diff)
🐛 fix issue with strange messages in the http body when max request
reached Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/http')
-rw-r--r--plugins/http/handler.go5
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
}
}