mirror of
https://github.com/golang/go
synced 2024-11-23 00:30:07 -07:00
net/http: remove superfluous newline on redirects
This commit is contained in:
parent
2184a39477
commit
29cabdcb3a
@ -2659,7 +2659,7 @@ func TestRedirectContentTypeAndBody(t *testing.T) {
|
||||
wantCT string
|
||||
wantBody string
|
||||
}{
|
||||
{MethodGet, nil, "text/html; charset=utf-8", "<a href=\"/foo\">Found</a>.\n\n"},
|
||||
{MethodGet, nil, "text/html; charset=utf-8", "<a href=\"/foo\">Found</a>.\n"},
|
||||
{MethodHead, nil, "text/html; charset=utf-8", ""},
|
||||
{MethodPost, nil, "", ""},
|
||||
{MethodDelete, nil, "", ""},
|
||||
|
@ -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 := "<a href=\"" + htmlEscape(url) + "\">" + StatusText(code) + "</a>.\n"
|
||||
body := "<a href=\"" + htmlEscape(url) + "\">" + StatusText(code) + "</a>."
|
||||
fmt.Fprintln(w, body)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user