@@ -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,39 +151,12 @@ 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 ) {
186- const startRiskRtt = Date . now ( ) ;
187159 ctx . riskRtt = 0 ;
188-
189160 try {
190161 if ( ! ctx . ip || ! ctx . uri ) {
191162 this . logger . error ( 'perimeterx score evaluation failed. bad parameters.' ) ;
@@ -203,6 +174,7 @@ class PxEnforcer {
203174 ctx . blockReason = 'cookie_high_score' ;
204175 return callback ( ScoreEvaluateAction . COOKIE_BLOCK_TRAFFIC ) ;
205176 }
177+ const startRiskRtt = Date . now ( ) ;
206178
207179 /* when no fallback to s2s call if cookie does not exist or failed on evaluation */
208180 pxApi . evalByServerCall ( ctx , this . _config , ( action ) => {
@@ -384,6 +356,9 @@ class PxEnforcer {
384356 pass_reason : ctx . passReason ,
385357 ...ctx . additionalFields ,
386358 } ;
359+ if ( ctx . serverInfoRegion ) {
360+ details [ 'server_info_region' ] = ctx . serverInfoRegion ;
361+ }
387362
388363 if ( ctx . passReason === PassReason . S2S_ERROR && ctx . s2sErrorInfo ) {
389364 this . setS2SErrorInfo ( details , ctx . s2sErrorInfo ) ;
@@ -432,6 +407,9 @@ class PxEnforcer {
432407 simulated_block : pxUtil . isReqInMonitorMode ( this . _config , ctx ) ,
433408 ...ctx . additionalFields ,
434409 } ;
410+ if ( ctx . serverInfoRegion ) {
411+ details [ 'server_info_region' ] = ctx . serverInfoRegion ;
412+ }
435413
436414 this . logger . debug ( `Sending block activity` ) ;
437415 this . pxClient . sendToPerimeterX ( ActivityType . BLOCK , details , ctx , this . _config ) ;
0 commit comments