summaryrefslogtreecommitdiff
path: root/service/http/handler.go
diff options
context:
space:
mode:
authorvalentin v / vvval <[email protected]>2019-02-21 15:17:40 +0300
committervalentin v / vvval <[email protected]>2019-02-21 15:17:40 +0300
commit46a52a8691e83c81a6d12183eddf188b5d15f011 (patch)
tree5aa06af7b90be39f72559eb8500c591d2bc411c9 /service/http/handler.go
parent3c1923606c7b5391678b7a760772c8e55f046025 (diff)
Rename MaxRequest config param
Added MaxRequestSize param, previous one is marked as deprecated, now they are merged
Diffstat (limited to 'service/http/handler.go')
-rw-r--r--service/http/handler.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/service/http/handler.go b/service/http/handler.go
index 8cebc42a..a7a6d4d0 100644
--- a/service/http/handler.go
+++ b/service/http/handler.go
@@ -75,12 +75,12 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
start := time.Now()
// validating request size
- if h.cfg.MaxRequest != 0 {
+ if h.cfg.MaxRequestSize != 0 {
if length := r.Header.Get("content-length"); length != "" {
if size, err := strconv.ParseInt(length, 10, 64); err != nil {
h.handleError(w, r, err, start)
return
- } else if size > h.cfg.MaxRequest*1024*1024 {
+ } else if size > h.cfg.MaxRequestSize*1024*1024 {
h.handleError(w, r, errors.New("request body max size is exceeded"), start)
return
}