Skip to content

Commit 3dbb4aa

Browse files
committed
Change CRL unavailable case to HTTP 404
1 parent c76dad8 commit 3dbb4aa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/crl.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func CRL(w http.ResponseWriter, r *http.Request) {
1818
}
1919

2020
if crlInfo == nil {
21-
render.Error(w, errs.New(http.StatusInternalServerError, "no CRL available"))
21+
render.Error(w, errs.New(http.StatusNotFound, "no CRL available"))
2222
return
2323
}
2424

api/crl_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func Test_CRL(t *testing.T) {
4545
{"ok/empty", "http://example.com/crl", nil, http.StatusOK, &authority.CertificateRevocationListInfo{Data: nil}, nil, http.Header{"Content-Type": []string{"application/pkix-crl"}, "Content-Disposition": []string{`attachment; filename="crl.der"`}}, ""},
4646
{"ok/empty-pem", "http://example.com/crl?pem=true", nil, http.StatusOK, &authority.CertificateRevocationListInfo{Data: nil}, emptyPEMData, http.Header{"Content-Type": []string{"application/x-pem-file"}, "Content-Disposition": []string{`attachment; filename="crl.pem"`}}, ""},
4747
{"fail/internal", "http://example.com/crl", errs.Wrap(http.StatusInternalServerError, errors.New("failure"), "authority.GetCertificateRevocationList"), http.StatusInternalServerError, nil, nil, http.Header{}, `{"status":500,"message":"The certificate authority encountered an Internal Server Error. Please see the certificate authority logs for more info."}`},
48-
{"fail/nil", "http://example.com/crl", nil, http.StatusInternalServerError, nil, nil, http.Header{}, `{"status":500,"message":"no CRL available"}`},
48+
{"fail/nil", "http://example.com/crl", nil, http.StatusNotFound, nil, nil, http.Header{}, `{"status":404,"message":"no CRL available"}`},
4949
}
5050

5151
for _, tt := range tests {

0 commit comments

Comments
 (0)