Merge branch 'master' into hs/scep

This commit is contained in:
Herman Slatman 2021-04-16 13:25:01 +02:00
commit 0487686f69
No known key found for this signature in database
GPG key ID: F4D8A44EA0A75A4F
62 changed files with 10768 additions and 11360 deletions

View file

@ -17,14 +17,14 @@ import (
func WriteError(w http.ResponseWriter, err error) {
switch k := err.(type) {
case *acme.Error:
w.Header().Set("Content-Type", "application/problem+json")
err = k.ToACME()
acme.WriteError(w, k)
return
case *scep.Error:
// TODO: check if this is correct; and should we do some more processing?
w.Header().Set("Content-Type", "text/plain")
default:
w.Header().Set("Content-Type", "application/json")
}
cause := errors.Cause(err)
if sc, ok := err.(errs.StatusCoder); ok {
w.WriteHeader(sc.StatusCode())