Commit fadeafac authored by Jonathan Rudenberg's avatar Jonathan Rudenberg Committed by Brad Fitzpatrick

net/http: add additional status codes defined in RFC 6585

428 Precondition Required
429 Too Many Requests
431 Request Header Fields Too Large
511 Network Authentication Required

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7678043
parent 9fcc37f7
......@@ -51,6 +51,13 @@ const (
StatusServiceUnavailable = 503
StatusGatewayTimeout = 504
StatusHTTPVersionNotSupported = 505
// New HTTP status codes from RFC 6585. Not exported yet in Go 1.1.
// See discussion at https://codereview.appspot.com/7678043/
statusPreconditionRequired = 428
statusTooManyRequests = 429
statusRequestHeaderFieldsTooLarge = 431
statusNetworkAuthenticationRequired = 511
)
var statusText = map[int]string{
......@@ -99,6 +106,11 @@ var statusText = map[int]string{
StatusServiceUnavailable: "Service Unavailable",
StatusGatewayTimeout: "Gateway Timeout",
StatusHTTPVersionNotSupported: "HTTP Version Not Supported",
statusPreconditionRequired: "Precondition Required",
statusTooManyRequests: "Too Many Requests",
statusRequestHeaderFieldsTooLarge: "Request Header Fields Too Large",
statusNetworkAuthenticationRequired: "Network Authentication Required",
}
// StatusText returns a text for the HTTP status code. It returns the empty
......
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