]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document that Error is to be used with plain text
authorAndrew Balholm <andybalholm@gmail.com>
Thu, 1 Aug 2013 19:05:05 +0000 (12:05 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 1 Aug 2013 19:05:05 +0000 (12:05 -0700)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12276043

src/pkg/net/http/server.go

index 5332239edeebff41e55e69d2a91fd566ac327ce7..4e8f6dce2e155749db93a912f1dd2f7ff9e4f48f 100644 (file)
@@ -1196,6 +1196,7 @@ func (f HandlerFunc) ServeHTTP(w ResponseWriter, r *Request) {
 // Helper handlers
 
 // Error replies to the request with the specified error message and HTTP code.
+// 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")
        w.WriteHeader(code)