Skip to content

Commit 1afe010

Browse files
kennygrantbradfitz
authored andcommitted
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 <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 655a4e1 commit 1afe010

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/net/http/server.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,6 @@ func (c *conn) serve(ctx context.Context) {
17631763
// while they're still writing their
17641764
// request. Undefined behavior.
17651765
const publicErr = "431 Request Header Fields Too Large"
1766-
c.server.logf("http: %s", publicErr)
17671766
fmt.Fprintf(c.rwc, "HTTP/1.1 "+publicErr+errorHeaders+publicErr)
17681767
c.closeWriteAndWait()
17691768
return
@@ -1777,7 +1776,6 @@ func (c *conn) serve(ctx context.Context) {
17771776
publicErr = publicErr + ": " + string(v)
17781777
}
17791778

1780-
c.server.logf("http: %s", publicErr)
17811779
fmt.Fprintf(c.rwc, "HTTP/1.1 "+publicErr+errorHeaders+publicErr)
17821780
return
17831781
}

0 commit comments

Comments
 (0)