mdeuser commented on a change in pull request #3919: Allow raw JSON string as 
response for webaction without base64 encoding.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3919#discussion_r207974264
 
 

 ##########
 File path: core/routemgmt/common/apigw-utils.js
 ##########
 @@ -954,16 +950,14 @@ function makeResponseObject(resp, isWebAction) {
     return resp;
   }
 
-  var bodystr;
+  var bodystr = resp;
   if (typeof resp === 'string') {
-    bodystr = makeJsonString(resp);
-  } else {
-    bodystr = JSON.stringify(resp);
+    bodystr = JSON.parse(makeJsonString(resp));
   }
   retobj = {
     statusCode: 200,
     headers: { 'Content-Type': 'application/json' },
-    body: new Buffer(bodystr).toString('base64')
+    body: bodystr
 
 Review comment:
   update comment above to remove the base64 business
   * body: Base64 encoded JSON error string

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to