1
0
mirror of https://github.com/golang/go synced 2024-11-27 00:51:26 -07:00

net/http: remove logging on bad client requests

As discussed in #18095 the server should not log for bad user input.

Change-Id: I628a796926eff3a971e5b04abec17ea377c3f9b7
Reviewed-on: https://go-review.googlesource.com/33617
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Kenny Grant 2016-11-29 20:40:40 +00:00 committed by Brad Fitzpatrick
parent 655a4e1284
commit 1afe0105a6

View File

@ -1763,7 +1763,6 @@ func (c *conn) serve(ctx context.Context) {
// while they're still writing their
// request. Undefined behavior.
const publicErr = "431 Request Header Fields Too Large"
c.server.logf("http: %s", publicErr)
fmt.Fprintf(c.rwc, "HTTP/1.1 "+publicErr+errorHeaders+publicErr)
c.closeWriteAndWait()
return
@ -1777,7 +1776,6 @@ func (c *conn) serve(ctx context.Context) {
publicErr = publicErr + ": " + string(v)
}
c.server.logf("http: %s", publicErr)
fmt.Fprintf(c.rwc, "HTTP/1.1 "+publicErr+errorHeaders+publicErr)
return
}