mirror of
https://github.com/golang/go
synced 2024-11-19 01:14:39 -07: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:
parent
683917a721
commit
00681eec6a
@ -1652,6 +1652,8 @@ func (f HandlerFunc) ServeHTTP(w ResponseWriter, r *Request) {
|
|||||||
// Helper handlers
|
// Helper handlers
|
||||||
|
|
||||||
// Error replies to the request with the specified error message and HTTP code.
|
// 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.
|
// The error message should be plain text.
|
||||||
func Error(w ResponseWriter, error string, code int) {
|
func Error(w ResponseWriter, error string, code int) {
|
||||||
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
||||||
|
Loading…
Reference in New Issue
Block a user