Skip to content

Commit

Permalink
perf(pdk):change naming and localize method
Browse files Browse the repository at this point in the history
  • Loading branch information
ProBrian committed Feb 7, 2025
1 parent 16b159c commit b40a178
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions kong/globalpatches.lua
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ return function(options)
-- READ REQUEST BODY [
_G.ngx.req.read_body = function()
-- for the same request, only one `read_body` call is needed
if not ngx.ctx.req_body_read then
if not ngx.ctx._req_body_has_read then
read_req_body()
ngx.ctx.req_body_read = true
ngx.ctx._req_body_has_read = true
end
end
-- ]
Expand Down
4 changes: 2 additions & 2 deletions kong/plugins/oauth2/access.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local ngx_decode_args = ngx.decode_args
local ngx_re_gmatch = ngx.re.gmatch
local ngx_decode_base64 = ngx.decode_base64
local ngx_encode_base64 = ngx.encode_base64

local ngx_var = ngx.var

local _M = {}

Expand Down Expand Up @@ -877,7 +877,7 @@ local function parse_access_token(conf)
parameters[ACCESS_TOKEN] = nil
kong.service.request.set_query(parameters)

local content_type = ngx.var.http_content_type
local content_type = ngx_var.http_content_type
local is_form_post = content_type and
string_find(content_type, "application/x-www-form-urlencoded", 1, true)

Expand Down

0 comments on commit b40a178

Please sign in to comment.