소스 검색

Update bad serial error to be more specific

max furman 4 년 전
부모
커밋
1dd0d7d0ee
2개의 변경된 파일과 2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      api/revoke.go
  2. 1 1
      api/revoke_test.go

+ 1 - 1
api/revoke.go

@@ -36,7 +36,7 @@ func (r *RevokeRequest) Validate() (err error) {
 	}
 	sn, ok := new(big.Int).SetString(r.Serial, 0)
 	if !ok {
-		return errs.BadRequest("'%s' is not a valid serial number - use a base 10 representation or add a prefix indicating the base", r.Serial)
+		return errs.BadRequest("'%s' is not a valid serial number - use a base 10 representation or a base 16 representation with '0x' prefix", r.Serial)
 	}
 	r.Serial = sn.String()
 	if r.ReasonCode < ocsp.Unspecified || r.ReasonCode > ocsp.AACompromise {

+ 1 - 1
api/revoke_test.go

@@ -33,7 +33,7 @@ func TestRevokeRequestValidate(t *testing.T) {
 		},
 		"error/bad sn": {
 			rr:  &RevokeRequest{Serial: "sn"},
-			err: &errs.Error{Err: errors.New("'sn' is not a valid serial number - use a base 10 representation or add a prefix indicating the base"), Status: http.StatusBadRequest},
+			err: &errs.Error{Err: errors.New("'sn' is not a valid serial number - use a base 10 representation or a base 16 representation with '0x' prefix"), Status: http.StatusBadRequest},
 		},
 		"error/bad reasonCode": {
 			rr: &RevokeRequest{