mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-08-14 06:30:19 +02:00
fix missing validation on allowed
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -33,6 +33,9 @@ func (r *AllowDeny) Validate() error {
|
||||
if err := validate.NullableFieldRequired("cidrs", r.Cidrs); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validate.NullableFieldRequired("filter type", r.Allowed); err != nil {
|
||||
return err
|
||||
}
|
||||
if v := r.Cidrs.MustGet(); len(v) == 0 {
|
||||
return errs.NewValidationError(
|
||||
errors.New("cidrs must include atleast one CIDR"),
|
||||
|
||||
Reference in New Issue
Block a user