You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/01/14 01:13:53 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #5923: feat: support custom package, headers and body in openwhisk plugin

spacewander commented on a change in pull request #5923:
URL: https://github.com/apache/apisix/pull/5923#discussion_r784439525



##########
File path: apisix/plugins/openwhisk.lua
##########
@@ -104,10 +108,30 @@ function _M.access(conf, ctx)
         return 503
     end
 
+    -- check if res.body is nil
+    if res.body == nil then
+        return res.status, res.body
+    end
+
+    -- parse OpenWhisk JSON response
+    -- OpenWhisk supports two types of responses, the user can return only
+    -- the response body, or set the status code and header.
+    local result, err = core.json.decode(res.body)
+
+    if not result or err then

Review comment:
       ```suggestion
       if not result then
   ```




-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org