@@ -19,7 +19,8 @@ def __init__(self, config_dict):
1919 self ._collector_host = 'collector.perimeterx.net' if app_id is None else px_constants .COLLECTOR_URL .format (
2020 app_id .lower ())
2121 self ._encryption_enabled = config_dict .get ('encryption_enabled' , True )
22- self ._sensitive_headers = map (lambda header : header .lower (), config_dict .get ('sensitive_headers' , ['cookie' , 'cookies' ]))
22+ self ._sensitive_headers = map (lambda header : header .lower (),
23+ config_dict .get ('sensitive_headers' , ['cookie' , 'cookies' ]))
2324 self ._send_page_activities = config_dict .get ('send_page_activities' , True )
2425 self ._api_timeout_ms = config_dict .get ('api_timeout' , 1000 )
2526 self ._custom_logo = custom_logo
@@ -35,8 +36,17 @@ def __init__(self, config_dict):
3536 self ._ip_headers = config_dict .get ('ip_headers' , [])
3637 self ._proxy_url = config_dict .get ('proxy_url' , None )
3738 self ._max_buffer_len = config_dict .get ('max_buffer_len' , 30 )
38- self ._sensitive_routes = config_dict .get ('sensitive_routes' , [])
39- self ._whitelist_routes = config_dict .get ('whitelist_routes' , [])
39+
40+ sensitive_routes = config_dict .get ('sensitive_routes' , [])
41+ if not isinstance (sensitive_routes , list ):
42+ raise TypeError ('sensitive_routes must be a list' )
43+ self ._sensitive_routes = sensitive_routes
44+
45+ whitelist_routes = config_dict .get ('whitelist_routes' , [])
46+ if not isinstance (whitelist_routes , list ):
47+ raise TypeError ('whitelist_routes must be a list' )
48+
49+ self ._whitelist_routes = whitelist_routes
4050 self ._block_html = 'BLOCK'
4151 self ._logo_visibility = 'visible' if custom_logo is not None else 'hidden'
4252 self ._telemetry_config = self .__create_telemetry_config ()
0 commit comments