From 15cfbacec988a77af347a5d3e6ea7b0b8fa2eed8 Mon Sep 17 00:00:00 2001 From: Sumit Suthar Date: Wed, 9 Oct 2024 13:07:31 +0530 Subject: [PATCH] update log for exclude API --- lib/instrumentation-security/core/request-manager.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/instrumentation-security/core/request-manager.js b/lib/instrumentation-security/core/request-manager.js index 8be02bd..1b23a60 100644 --- a/lib/instrumentation-security/core/request-manager.js +++ b/lib/instrumentation-security/core/request-manager.js @@ -24,14 +24,12 @@ function getRequestFromId(id) { * @param {*} requestData */ function setRequest(id, requestData) { - if (API.getSecAgent().status.getStatus() != 'active') { - return; - } + requestMap.set(id, requestData); try { const stringToMatch = requestData.url; // const filteredString = stringToMatch.split('?')[0]; - const filteredString = stringToMatch; + const filteredString = stringToMatch; let isRegexMatchestoURL = false; for (let index = 0; index < regexPatterns.length; index++) { const regex = new RegExp(regexPatterns[index], 'gm'); @@ -45,7 +43,9 @@ function setRequest(id, requestData) { } if (isRegexMatchestoURL) { requestMap.delete(id); - logger.debug("Excluding URL %s from IAST processing due to ignore API setting", filteredString); + if (API.getSecAgent().status.getStatus() !== 'disabled') { + logger.debug("Excluding URL %s from IAST processing due to ignore API setting", filteredString); + } } } catch (error) { logger.debug("Error while processing API regex for restriction", error);