Skip to content

Commit 4d7b187

Browse files
authored
Merge pull request #341 from PerimeterX/dev
GQL fix
2 parents 2086061 + b173de2 commit 4d7b187

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/px/pxnginx.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function M.application(px_configuration_table)
6363
local reverse_prefix_appid = string.sub(px_config.px_appId, 3, string.len(px_config.px_appId))
6464
local reverse_prefix = px_config.first_party_prefix ~= nil and px_config.first_party_prefix .. '/' .. reverse_prefix_appid or reverse_prefix_appid
6565
local lower_request_url = string.lower(ngx.var.request_uri)
66+
local lower_request_path = string.lower(ngx.var.uri)
6667

6768
-- Internal wrapper function, will check if uri match first party route and forward the request if uri was matched
6869
local function is_first_party_request(reverse_prefix, lower_request_url)
@@ -301,7 +302,7 @@ function M.application(px_configuration_table)
301302
ngx.ctx.pxvid = pxvid
302303
end
303304

304-
local graphql = px_graphql.extract(lower_request_url)
305+
local graphql = px_graphql.extract(lower_request_path)
305306
if graphql then
306307
details["graphql_operation_name"] = graphql["operationName"]
307308
details["graphql_operation_type"] = graphql["operationType"]

lib/px/utils/config_builder.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ PX_DEFAULT_CONFIGURATIONS["postpone_page_requested"] = { false, "boolean"}
6868
PX_DEFAULT_CONFIGURATIONS["hypesale_host"] = { "https://captcha.px-cdn.net", "string"}
6969
PX_DEFAULT_CONFIGURATIONS["px_sensitive_graphql_operation_types"] = { {}, "table"}
7070
PX_DEFAULT_CONFIGURATIONS["px_sensitive_graphql_operation_names"] = { {}, "table"}
71-
PX_DEFAULT_CONFIGURATIONS["px_graphql_routes"] = { {'/graphql'}, "table"}
71+
PX_DEFAULT_CONFIGURATIONS["px_graphql_routes"] = { {}, "table"}
7272
PX_DEFAULT_CONFIGURATIONS["px_enable_login_creds_extraction"] = { false, "boolean"}
7373
PX_DEFAULT_CONFIGURATIONS["px_login_creds_settings_filename"] = { nil, "string"}
7474
PX_DEFAULT_CONFIGURATIONS["px_login_creds_settings"] = { nil, "table"}
@@ -131,7 +131,7 @@ function _M.load(px_config)
131131
end
132132

133133
-- set default GraphQL route
134-
if not px_config.px_graphql_routes then
134+
if next(px_config.px_graphql_routes) == nil then
135135
table.insert(px_config.px_graphql_routes, px_constants.GRAPHQL_PATH)
136136
end
137137

0 commit comments

Comments
 (0)