From 1ac9ccbb8ba10d280c72e54f83bda7cab4049561 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Tue, 5 Nov 2024 00:11:44 +0530 Subject: [PATCH] Reject blocklist-by-query API requests with no query. --- cmd/subscribers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/subscribers.go b/cmd/subscribers.go index 306be690..f366f67c 100644 --- a/cmd/subscribers.go +++ b/cmd/subscribers.go @@ -462,6 +462,10 @@ func handleBlocklistSubscribersByQuery(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.BlocklistSubscribersByQuery(req.Query, req.ListIDs, req.SubscriptionStatus); err != nil { return err }