mirror of
https://github.com/outbackdingo/certificates.git
synced 2026-01-28 02:18:28 +00:00
Prevent internal errors from being returned to ACME clients
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user