soulbird commented on code in PR #11289:
URL: https://github.com/apache/apisix/pull/11289#discussion_r1749465578
##########
apisix/core/ctx.lua:
##########
@@ -274,6 +276,22 @@ do
end
end
+ elseif core_str.has_prefix(key, "json_body_arg_") then
+ -- only match json type request body
+ local content_type = request.header(nil, "Content-Type")
+ if content_type ~= nil and core_str.has_prefix(content_type,
+ "application/json") then
+ local arg_key = sub_str(key, 15)
+ local raw_request_body = request.get_body()
+ local body, err = json.decode(raw_request_body)
Review Comment:
Consider using a cache, as this code may be executed multiple times on hot
paths.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]