From bbc1a369ed64afb32dc70177321547e82fbd15c5 Mon Sep 17 00:00:00 2001 From: Katherine Chen Date: Wed, 7 Aug 2024 15:51:39 +1000 Subject: [PATCH] Modify logic for verifying site id --- .../java/com/uid2/admin/vertx/service/SharingService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/uid2/admin/vertx/service/SharingService.java b/src/main/java/com/uid2/admin/vertx/service/SharingService.java index 46ad53cc..28e509cc 100644 --- a/src/main/java/com/uid2/admin/vertx/service/SharingService.java +++ b/src/main/java/com/uid2/admin/vertx/service/SharingService.java @@ -165,10 +165,13 @@ private void handleListAllKeysetsRelated(RoutingContext rc) { try { // Get value for site id final Optional siteIdOpt = RequestUtil.getSiteId(rc, "site_id"); - if (!siteIdOpt.isPresent()) return; + if (!siteIdOpt.isPresent()) { + ResponseUtil.error(rc, 400, "must specify a site id"); + return; + } final int siteId = siteIdOpt.get(); - if (siteId != Const.Data.AdvertisingTokenSiteId && !SiteUtil.isValidSiteId(siteId)) { + if (!SiteUtil.isValidSiteId(siteId)) { ResponseUtil.error(rc, 400, "must specify a valid site id"); return; }