mirror of
https://github.com/outbackdingo/estserver.git
synced 2026-01-28 10:18:50 +00:00
Make validateRequest handling more foolproof
Signed-off-by: Andy Doan <andy@foundries.io>
This commit is contained in:
@@ -28,7 +28,7 @@ func RegisterEchoHandlers(svcHandler ServiceHandler, e *echo.Echo) {
|
||||
return c.String(http.StatusInternalServerError, err.Error())
|
||||
}
|
||||
bytes, err := validateRequest(svc, c)
|
||||
if err != nil {
|
||||
if err != nil || bytes == nil { // validateRequest failed and sent the response
|
||||
return err
|
||||
}
|
||||
bytes, err = svc.Enroll(c.Request().Context(), bytes)
|
||||
@@ -46,7 +46,7 @@ func RegisterEchoHandlers(svcHandler ServiceHandler, e *echo.Echo) {
|
||||
return c.String(http.StatusInternalServerError, err.Error())
|
||||
}
|
||||
bytes, err := validateRequest(svc, c)
|
||||
if bytes == nil { // validateRequest failed and sent the response
|
||||
if err != nil || bytes == nil { // validateRequest failed and sent the response
|
||||
return err
|
||||
}
|
||||
peerCerts := c.Request().TLS.PeerCertificates
|
||||
|
||||
Reference in New Issue
Block a user