Skip to content

Commit

Permalink
Reject query-by-delete API requests with no query. Ref #2122.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Nov 4, 2024
1 parent d8a394d commit ac5e101
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/subscribers.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ func handleDeleteSubscribersByQuery(c echo.Context) error {
return err
}

if req.Query == "" {
return echo.NewHTTPError(http.StatusBadRequest, app.i18n.Ts("globals.messages.invalidFields", "name", "query"))
}

if err := app.core.DeleteSubscribersByQuery(req.Query, req.ListIDs, req.SubscriptionStatus); err != nil {
return err
}
Expand Down

0 comments on commit ac5e101

Please # to comment.