openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From japet...@apache.org
Subject [incubator-openwhisk-package-cloudant] branch master updated: remove the use of base64 for webaction response (#176)
Date Tue, 31 Jul 2018 13:42:37 GMT
This is an automated email from the ASF dual-hosted git repository.

japetrsn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-cloudant.git


The following commit(s) were added to refs/heads/master by this push:
     new e56ca1f  remove the use of base64 for webaction response (#176)
e56ca1f is described below

commit e56ca1f5821a1e093ecb43a3d6eca5954ddf5b4a
Author: Carlos Santana <csantanapr@apache.org>
AuthorDate: Tue Jul 31 09:42:35 2018 -0400

    remove the use of base64 for webaction response (#176)
    
    * remove the use of base64 for webaction response
    
    * moar changes
---
 .gitignore                  |  8 ++++++++
 actions/changesWebAction.js | 10 +++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4f86fab..3af456f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,11 @@ node_modules/
 action/*.zip
 .idea
 *.iml
+
+# Eclipse
+bin/
+**/.project
+.settings/
+.classpath
+.cache-main
+.cache-tests
diff --git a/actions/changesWebAction.js b/actions/changesWebAction.js
index b72e35d..1bade20 100644
--- a/actions/changesWebAction.js
+++ b/actions/changesWebAction.js
@@ -91,7 +91,7 @@ function main(params) {
                  resolve({
                      statusCode: 200,
                      headers: {'Content-Type': 'application/json'},
-                     body: new Buffer(JSON.stringify({'status': 'success'})).toString('base64')
+                     body: {'status': 'success'}
                  });
             })
             .catch(err => {
@@ -131,7 +131,7 @@ function main(params) {
                 resolve({
                     statusCode: 200,
                     headers: {'Content-Type': 'application/json'},
-                    body: new Buffer(JSON.stringify(body)).toString('base64')
+                    body: body
                 });
             })
             .catch(err => {
@@ -186,7 +186,7 @@ function main(params) {
                 resolve({
                     statusCode: 200,
                     headers: {'Content-Type': 'application/json'},
-                    body: new Buffer(JSON.stringify({'status': 'success'})).toString('base64')
+                    body: {'status': 'success'}
                 });
            })
            .catch(err => {
@@ -208,7 +208,7 @@ function main(params) {
                 resolve({
                     statusCode: 200,
                     headers: {'Content-Type': 'application/json'},
-                    body: new Buffer(JSON.stringify({'status': 'success'})).toString('base64')
+                    body: {'status': 'success'}
                 });
             })
             .catch(err => {
@@ -468,7 +468,7 @@ function sendError(statusCode, error, message) {
     return {
         statusCode: statusCode,
         headers: { 'Content-Type': 'application/json' },
-        body: new Buffer(JSON.stringify(params)).toString('base64')
+        body: params
     };
 }
 


Mime
View raw message