Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/added header based logger + addedrisk_start_time and enforcer_start_time fields to activities #171

Merged
merged 13 commits into from
Dec 21, 2023
Prev Previous commit
Next Next commit
Fix
chen-zimmer-px committed Nov 28, 2023
commit cba6f1440adac030f7a1baabeb7d762b0a29fb32
9 changes: 3 additions & 6 deletions lib/pxenforcer.js
Original file line number Diff line number Diff line change
@@ -80,12 +80,12 @@ class PerimeterXEnforcer {
parseCookies(req, res).then(() => {
enforcer.enforce(req, res, (err, response) => {
let pxContext = null;
if (req.locals && req.locals.pxCtx) {
pxContext = req.locals.pxCtx;
}
if (!err && response) {
PerimeterXEnforcer.handleCallbackResponse(err, response, res);

if (req.locals && req.locals.pxCtx) {
pxContext = req.locals.pxCtx;
}
enforcer.sendHeaderBasedLogs(pxContext, enforcer.config.conf, req);
} else {
//pass
@@ -102,9 +102,6 @@ class PerimeterXEnforcer {
}
});

if (req.locals && req.locals.pxCtx) {
pxContext = req.locals.pxCtx;
}
enforcer.sendHeaderBasedLogs(pxContext, enforcer.config.conf, req);

next();