]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: add StatusTooEarly (425)
authorLeon Klingele <git@leonklingele.de>
Mon, 3 Dec 2018 04:44:48 +0000 (04:44 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 3 Dec 2018 06:01:35 +0000 (06:01 +0000)
StatusTooEarly can be returned to indicate that a server is unwilling
to accept early data as introduced in TLS 1.3.
The status code was specified in RFC 8470, section 5.2.

Major supported browsers are:
- Firefox as of version 58
  https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/425#Browser_compatibility
- Chromium as of version 73.0.3628.1
  https://chromium.googlesource.com/chromium/src/+/58097ec3823e0f340ab5abfcaec1306e1d954c5a

Change-Id: I3f62f4193bae198994d08fde7e92e0ccd080e59a
GitHub-Last-Rev: fa885040eaf80e0e33b571567108d8a9ded67801
GitHub-Pull-Request: golang/go#29073
Reviewed-on: https://go-review.googlesource.com/c/152118
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/status.go

index dd72d67be911de7d8298bf6f4cbf1adbdb854317..086f3d1a71ed56bcd93e5a66fb62a26429968f4d 100644 (file)
@@ -55,6 +55,7 @@ const (
        StatusUnprocessableEntity          = 422 // RFC 4918, 11.2
        StatusLocked                       = 423 // RFC 4918, 11.3
        StatusFailedDependency             = 424 // RFC 4918, 11.4
+       StatusTooEarly                     = 425 // RFC 8470, 5.2.
        StatusUpgradeRequired              = 426 // RFC 7231, 6.5.15
        StatusPreconditionRequired         = 428 // RFC 6585, 3
        StatusTooManyRequests              = 429 // RFC 6585, 4
@@ -122,6 +123,7 @@ var statusText = map[int]string{
        StatusUnprocessableEntity:          "Unprocessable Entity",
        StatusLocked:                       "Locked",
        StatusFailedDependency:             "Failed Dependency",
+       StatusTooEarly:                     "Too Early",
        StatusUpgradeRequired:              "Upgrade Required",
        StatusPreconditionRequired:         "Precondition Required",
        StatusTooManyRequests:              "Too Many Requests",