Validate type
in bounce webhook API.
This commit is contained in:
parent
158ea9fad2
commit
27e1e83d0b
1 changed files with 4 additions and 0 deletions
|
@ -239,6 +239,10 @@ func validateBounceFields(b models.Bounce, app *App) error {
|
|||
return echo.NewHTTPError(http.StatusBadRequest, app.i18n.T("globals.messages.invalidData"))
|
||||
}
|
||||
|
||||
if b.Type != models.BounceTypeHard && b.Type != models.BounceTypeSoft {
|
||||
return echo.NewHTTPError(http.StatusBadRequest, app.i18n.T("globals.messages.invalidData"))
|
||||
}
|
||||
|
||||
if b.Email != "" && !subimporter.IsEmail(b.Email) {
|
||||
return echo.NewHTTPError(http.StatusBadRequest, app.i18n.T("globals.messages.invalidEmail"))
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue