From 1afe0105a6c415fe204fcb778e042210f1225b47 Mon Sep 17 00:00:00 2001 From: Kenny Grant Date: Tue, 29 Nov 2016 20:40:40 +0000 Subject: [PATCH] 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 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/net/http/server.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/net/http/server.go b/src/net/http/server.go index e8b5c139a1..6df9c260e4 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -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 } -- 2.50.0