Prevent internal errors from being returned to ACME clients

pull/1496/head
Herman Slatman 10 months ago
parent 979e0f8f51
commit d5dd8feccd
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F

@ -309,6 +309,12 @@ func (e *Error) AddSubproblems(subproblems ...Subproblem) *Error {
// to the existing (default) ACME error detail, providing
// more information to the ACME client.
func (e *Error) WithAdditionalErrorDetail() *Error {
// prevent internal server errors from disclosing
// the internal error to the client.
if e.Status >= 500 {
return e
}
e.Detail = fmt.Sprintf("%s: %s", e.Detail, e.Err)
return e
}

Loading…
Cancel
Save