wilsonGen commented on code in PR #11289:
URL: https://github.com/apache/apisix/pull/11289#discussion_r1705057491


##########
apisix/core/ctx.lua:
##########
@@ -274,6 +276,19 @@ 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 = cjson.decode(raw_request_body)
+                    if body then
+                        val = utils.get_nested_json_value(body, arg_key)

Review Comment:
   yes, just updated code using jsonpath, thank you. 😃 



-- 
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]

Reply via email to