This repository was archived by the owner on Oct 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-30
lines changed
Expand file tree Collapse file tree 2 files changed +3
-30
lines changed Original file line number Diff line number Diff line change @@ -133,8 +133,6 @@ class PxEnforcer {
133133 }
134134
135135 shouldFilterRequest ( req ) {
136- let shouldFilterRoute = false ;
137-
138136 if ( pxUtil . checkForStatic ( req , this . _config . STATIC_FILES_EXT ) ) {
139137 this . logger . debug ( `Found whitelist ext in path: ${ req . originalUrl } ` ) ;
140138 return true ;
@@ -153,33 +151,8 @@ class PxEnforcer {
153151 }
154152 }
155153 }
156-
157- if ( this . _config . ENFORCED_ROUTES && this . _config . ENFORCED_ROUTES . length > 0 ) {
158- for ( const enforceRoute of this . _config . ENFORCED_ROUTES ) {
159- if ( enforceRoute instanceof RegExp && req . originalUrl . match ( enforceRoute ) ) {
160- return false ;
161- }
162- if ( typeof enforceRoute === 'string' && req . originalUrl . startsWith ( enforceRoute ) ) {
163- return false ;
164- }
165- }
166- this . logger . debug ( `Route ${ req . originalUrl } is not listed in specific routes to enforce` ) ;
167- shouldFilterRoute = true ;
168- }
169-
170- if ( this . _config . MONITORED_ROUTES && this . _config . MONITORED_ROUTES . length > 0 ) {
171- for ( const monitorRoute of this . _config . MONITORED_ROUTES ) {
172- if ( monitorRoute instanceof RegExp && req . originalUrl . match ( monitorRoute ) ) {
173- return false ;
174- }
175- if ( typeof monitorRoute === 'string' && req . originalUrl . startsWith ( monitorRoute ) ) {
176- return false ;
177- }
178- }
179- this . logger . debug ( `Route ${ req . path } is not listed in specific routes to monitor` ) ;
180- }
181-
182- return shouldFilterRoute ;
154+
155+ return false ;
183156 }
184157
185158 verifyUserScore ( ctx , callback ) {
Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ function generateHMAC(cookieSecret, payload) {
249249
250250function isReqInMonitorMode ( pxConfig , pxCtx ) {
251251 return (
252- ( pxConfig . MODULE_MODE === ModuleMode . MONITOR && ! pxCtx . shouldBypassMonitor ) || pxCtx . monitoredRoute
252+ ( pxConfig . MODULE_MODE === ModuleMode . MONITOR && ! pxCtx . shouldBypassMonitor && ! pxCtx . enforcedRoute ) || pxCtx . monitoredRoute
253253 ) ;
254254}
255255
You can’t perform that action at this time.
0 commit comments