Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion perimeterx/px_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def prepare_risk_body(ctx, config):
'http_version': ctx.get('http_version', ''),
'module_version': config.get('module_version', ''),
'risk_mode': config.get('module_mode', ''),
'px_cookie_hmac': ctx.get('cookie_hmac', '')
'px_cookie_hmac': ctx.get('cookie_hmac', ''),
'request_cookie_names': ctx.get('cookie_names', '')
}
}

Expand Down
5 changes: 4 additions & 1 deletion perimeterx/px_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def build_context(environ, config):
http_version = '1.1'
http_protocol = 'http://'
px_cookies = {}
requestCookieNames = list()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use snake case for variable names


# IP Extraction
if config.get('ip_handler'):
Expand All @@ -37,6 +38,7 @@ def build_context(environ, config):
cookie_keys = cookies.keys()

for key in cookie_keys:
requestCookieNames.append(key)
if key == PREFIX_PX_COOKIE_V1 or key == PREFIX_PX_COOKIE_V3:
logger.debug('Found cookie prefix:' + key)
px_cookies[key] = cookies.get(key).value
Expand All @@ -54,6 +56,7 @@ def build_context(environ, config):
'full_url': full_url,
'uri': uri,
'hostname': hostname,
'px_cookies': px_cookies
'px_cookies': px_cookies,
'cookie_names': requestCookieNames
}
return ctx