Skip to content

Commit

Permalink
Merge pull request #341 from PerimeterX/dev
Browse files Browse the repository at this point in the history
GQL fix
  • Loading branch information
wizzard authored Dec 26, 2024
2 parents 2086061 + b173de2 commit 4d7b187
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/px/pxnginx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function M.application(px_configuration_table)
local reverse_prefix_appid = string.sub(px_config.px_appId, 3, string.len(px_config.px_appId))
local reverse_prefix = px_config.first_party_prefix ~= nil and px_config.first_party_prefix .. '/' .. reverse_prefix_appid or reverse_prefix_appid
local lower_request_url = string.lower(ngx.var.request_uri)
local lower_request_path = string.lower(ngx.var.uri)

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

local graphql = px_graphql.extract(lower_request_url)
local graphql = px_graphql.extract(lower_request_path)
if graphql then
details["graphql_operation_name"] = graphql["operationName"]
details["graphql_operation_type"] = graphql["operationType"]
Expand Down
4 changes: 2 additions & 2 deletions lib/px/utils/config_builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ PX_DEFAULT_CONFIGURATIONS["postpone_page_requested"] = { false, "boolean"}
PX_DEFAULT_CONFIGURATIONS["hypesale_host"] = { "https://captcha.px-cdn.net", "string"}
PX_DEFAULT_CONFIGURATIONS["px_sensitive_graphql_operation_types"] = { {}, "table"}
PX_DEFAULT_CONFIGURATIONS["px_sensitive_graphql_operation_names"] = { {}, "table"}
PX_DEFAULT_CONFIGURATIONS["px_graphql_routes"] = { {'/graphql'}, "table"}
PX_DEFAULT_CONFIGURATIONS["px_graphql_routes"] = { {}, "table"}
PX_DEFAULT_CONFIGURATIONS["px_enable_login_creds_extraction"] = { false, "boolean"}
PX_DEFAULT_CONFIGURATIONS["px_login_creds_settings_filename"] = { nil, "string"}
PX_DEFAULT_CONFIGURATIONS["px_login_creds_settings"] = { nil, "table"}
Expand Down Expand Up @@ -131,7 +131,7 @@ function _M.load(px_config)
end

-- set default GraphQL route
if not px_config.px_graphql_routes then
if next(px_config.px_graphql_routes) == nil then
table.insert(px_config.px_graphql_routes, px_constants.GRAPHQL_PATH)
end

Expand Down

0 comments on commit 4d7b187

Please sign in to comment.