From 4973a80f64ca83ca8e31038946d6db742fc1a303 Mon Sep 17 00:00:00 2001 From: "Peter.Morton" Date: Mon, 16 Oct 2023 21:51:15 -0500 Subject: [PATCH] return NotFound if no property key is provided --- src/api/routes/tps.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/api/routes/tps.js b/src/api/routes/tps.js index 54621ce..c317d79 100644 --- a/src/api/routes/tps.js +++ b/src/api/routes/tps.js @@ -20,6 +20,16 @@ router.get("/", async (req, res, next) => { const propertyName = req.query.propertyName; const { host, tenant, token } = auth; logger.debug(`tps GET ${propertyName} from ${host}`); + + if (!propertyName || propertyName.length == 0) { + next( + new createHttpError.NotFound( + `Blank property keys not allowed` + ) + ); + return; + } + axios .get( `${host}/tenant-properties-service/${tenant}/properties?q=${propertyName}`,