]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: remove logging on bad client requests
authorKenny Grant <kennygrant@gmail.com>
Tue, 29 Nov 2016 20:40:40 +0000 (20:40 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 30 Nov 2016 00:34:42 +0000 (00:34 +0000)
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>

src/net/http/server.go

index e8b5c139a1fd003b9f50d85ad72f978767279311..6df9c260e4a37c33885826d23988fa2c5e659b9a 100644 (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
                }