mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-14 15:56:44 +03:00
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.
This commit is contained in:
committed by
Kirill Danshin
parent
77385190fb
commit
fbf4b2d9cd
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user