From 2185c37e73c1ff143694dca5ea37c6bf54c3838a Mon Sep 17 00:00:00 2001 From: Souravdey777 Date: Mon, 25 Jan 2021 23:53:09 +0530 Subject: [PATCH] limit error check added --- app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app.js b/app.js index ddb4b65..8424f2a 100644 --- a/app.js +++ b/app.js @@ -199,6 +199,10 @@ app.get('/getLatestHashnodeBlog', async (request, response) => { let limit = 3; if (request.query.limit) { limit = request.query.limit; + if (limit > 6) { + response.write(JSON.stringify({ error: 'limit parameters is more than 6!' })); + response.end(); + } } const large = request.query.large === "true" ? true : false const resultData = (await getLatestHashnodeBlog(username));