nic-6443 commented on code in PR #13407:
URL: https://github.com/apache/apisix/pull/13407#discussion_r3279073409


##########
apisix/core/request_json.lua:
##########
@@ -28,6 +28,35 @@ local configured_name
 local _M = {}
 
 
+local function qjson_decode(str)
+    local ok, decoded, err = pcall(qjson.decode, str)
+    if not ok then
+        return nil, tostring(decoded)
+    end
+
+    if not decoded then
+        return nil, err
+    end
+
+    ok, decoded = pcall(qjson.materialize, decoded)
+    if not ok then
+        return nil, tostring(decoded)
+    end
+

Review Comment:
   Good catch. Updated the qjson materialize wrapper to preserve the 
non-throwing `nil, err` return path, and localized the built-ins used by the 
wrapper.



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