Browse Source

Add HTTP_1_1_REQUIRED error code.

Brad Fitzpatrick 11 years ago
parent
commit
b0b6955472
2 changed files with 3 additions and 0 deletions
  1. 2 0
      errors.go
  2. 1 0
      errors_test.go

+ 2 - 0
errors.go

@@ -24,6 +24,7 @@ const (
 	ErrCodeConnect            ErrCode = 0xa
 	ErrCodeEnhanceYourCalm    ErrCode = 0xb
 	ErrCodeInadequateSecurity ErrCode = 0xc
+	ErrCodeHTTP11Required     ErrCode = 0xd
 )
 
 var errCodeName = map[ErrCode]string{
@@ -40,6 +41,7 @@ var errCodeName = map[ErrCode]string{
 	ErrCodeConnect:            "CONNECT_ERROR",
 	ErrCodeEnhanceYourCalm:    "ENHANCE_YOUR_CALM",
 	ErrCodeInadequateSecurity: "INADEQUATE_SECURITY",
+	ErrCodeHTTP11Required:     "HTTP_1_1_REQUIRED",
 }
 
 func (e ErrCode) String() string {

+ 1 - 0
errors_test.go

@@ -15,6 +15,7 @@ func TestErrCodeString(t *testing.T) {
 		want string
 	}{
 		{ErrCodeProtocol, "PROTOCOL_ERROR"},
+		{0xd, "HTTP_1_1_REQUIRED"},
 		{0xf, "unknown error code 0xf"},
 	}
 	for i, tt := range tests {