1
0
mirror of https://github.com/golang/go synced 2024-07-08 12:18:55 +00:00

net/http: document Error does not end the request

Fixes #15205

Change-Id: Ia650806756758ca8ed2272b1696e59b809b16c61
Reviewed-on: https://go-review.googlesource.com/21836
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Dan Peterson 2016-04-11 11:15:00 -03:00 committed by Brad Fitzpatrick
parent 683917a721
commit 00681eec6a

View File

@ -1652,6 +1652,8 @@ func (f HandlerFunc) ServeHTTP(w ResponseWriter, r *Request) {
// Helper handlers
// Error replies to the request with the specified error message and HTTP code.
// It does not otherwise end the request; the caller should ensure no further
// writes are done to w.
// The error message should be plain text.
func Error(w ResponseWriter, error string, code int) {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")