From 00681eec6aec03b8b2822c9220fba27c18923c01 Mon Sep 17 00:00:00 2001 From: Dan Peterson Date: Mon, 11 Apr 2016 11:15:00 -0300 Subject: [PATCH] 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 --- src/net/http/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/net/http/server.go b/src/net/http/server.go index e37df99deb0..7a6950aee4b 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -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")