Commit 00681eec authored by Dan Peterson's avatar Dan Peterson Committed by Brad Fitzpatrick

net/http: document Error does not end the request

Fixes #15205

Change-Id: Ia650806756758ca8ed2272b1696e59b809b16c61
Reviewed-on: https://go-review.googlesource.com/21836Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 683917a7
......@@ -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")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment