From 676202a31e22cd2f45cdd3ae1a14497181db0348 Mon Sep 17 00:00:00 2001 From: Carter Date: Thu, 11 Aug 2016 19:08:49 -0400 Subject: [PATCH] Fixed styling and byte count --- caddyhttp/httpserver/replacer.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/caddyhttp/httpserver/replacer.go b/caddyhttp/httpserver/replacer.go index 5b84c88e..9dc8f3dd 100644 --- a/caddyhttp/httpserver/replacer.go +++ b/caddyhttp/httpserver/replacer.go @@ -147,17 +147,16 @@ func NewReplacer(r *http.Request, rr *ResponseRecorder, emptyValue string) Repla return rep } -func canLogRequest(r *http.Request) (canLog bool) { +func canLogRequest(r *http.Request) bool { if r.Method == "POST" || r.Method == "PUT" { for _, cType := range r.Header[headerContentType] { // the cType could have charset and other info if strings.Index(cType, contentTypeJSON) > -1 || strings.Index(cType, contentTypeXML) > -1 { - canLog = true - break + return true } } } - return + return false } // readRequestBody reads the request body and sets a @@ -280,5 +279,5 @@ const ( headerContentType = "Content-Type" contentTypeJSON = "application/json" contentTypeXML = "application/xml" - maxLogBodySize = 100 * 1000 + maxLogBodySize = 100 * 1024 )