diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index 0c76f1bcc4e..64b5e3e3568 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -2659,7 +2659,7 @@ func TestRedirectContentTypeAndBody(t *testing.T) { wantCT string wantBody string }{ - {MethodGet, nil, "text/html; charset=utf-8", "Found.\n\n"}, + {MethodGet, nil, "text/html; charset=utf-8", "Found.\n"}, {MethodHead, nil, "text/html; charset=utf-8", ""}, {MethodPost, nil, "", ""}, {MethodDelete, nil, "", ""}, diff --git a/src/net/http/server.go b/src/net/http/server.go index 92457785908..06d12c959b9 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -2273,7 +2273,7 @@ func Redirect(w ResponseWriter, r *Request, url string, code int) { // Shouldn't send the body for POST or HEAD; that leaves GET. if !hadCT && r.Method == "GET" { - body := "" + StatusText(code) + ".\n" + body := "" + StatusText(code) + "." fmt.Fprintln(w, body) } }