internal: don't send an empty error element

According to RFC 4918 section 14.5, the error element can't be empty.
This commit is contained in:
Simon Ser 2022-05-02 20:41:33 +02:00
parent 3f8b212b0d
commit d8a8af0448

View File

@ -143,9 +143,7 @@ func NewErrorResponse(path string, err error) *Response {
} }
var errElt *Error var errElt *Error
if !errors.As(err, &errElt) { errors.As(err, &errElt)
errElt = &Error{}
}
href := Href{Path: path} href := Href{Path: path}
return &Response{ return &Response{