Change CRL unavailable case to HTTP 404

pull/1708/head
Herman Slatman 3 months ago
parent c76dad8a22
commit 3dbb4aad3d
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F

@ -18,7 +18,7 @@ func CRL(w http.ResponseWriter, r *http.Request) {
}
if crlInfo == nil {
render.Error(w, errs.New(http.StatusInternalServerError, "no CRL available"))
render.Error(w, errs.New(http.StatusNotFound, "no CRL available"))
return
}

@ -45,7 +45,7 @@ func Test_CRL(t *testing.T) {
{"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"`}}, ""},
{"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"`}}, ""},
{"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."}`},
{"fail/nil", "http://example.com/crl", nil, http.StatusInternalServerError, nil, nil, http.Header{}, `{"status":500,"message":"no CRL available"}`},
{"fail/nil", "http://example.com/crl", nil, http.StatusNotFound, nil, nil, http.Header{}, `{"status":404,"message":"no CRL available"}`},
}
for _, tt := range tests {

Loading…
Cancel
Save