From fbf4b2d9cd9a9bb84baf187775bf90cab15a3728 Mon Sep 17 00:00:00 2001 From: Erik Dubbelboer Date: Sun, 26 Aug 2018 16:07:42 +0800 Subject: [PATCH] Do not log ErrSmallBuffer for request headers fasthttp returns a 431 error when the request headers are too large. Most other HTTP servers do not log an error when the request header exceeds the limit. When serving HTTP requests directly to browsers, it is normal to occasionally hit the limit due to broken browsers or broken sites linking to your resource. These issues are generally outside of your control in the same way the already ignored errors are. --- workerpool.go | 1 + 1 file changed, 1 insertion(+) diff --git a/workerpool.go b/workerpool.go index 081ac65..6ce2778 100644 --- a/workerpool.go +++ b/workerpool.go @@ -211,6 +211,7 @@ func (wp *workerPool) workerFunc(ch *workerChan) { errStr := err.Error() if wp.LogAllErrors || !(strings.Contains(errStr, "broken pipe") || strings.Contains(errStr, "reset by peer") || + strings.Contains(errStr, "request headers: small read buffer") || strings.Contains(errStr, "i/o timeout")) { wp.Logger.Printf("error when serving connection %q<->%q: %s", c.LocalAddr(), c.RemoteAddr(), err) }