You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ja...@apache.org on 2018/07/31 03:31:41 UTC

[incubator-openwhisk-package-alarms] branch master updated: remove the use of base64 for webaction response (#156)

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-alarms.git


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

commit 0d5ca7c6a2682d8e92466b3b2fa6a4975d035f2b
Author: Carlos Santana <cs...@apache.org>
AuthorDate: Mon Jul 30 23:31:39 2018 -0400

    remove the use of base64 for webaction response (#156)
---
 .gitignore               | 8 ++++++++
 action/alarmWebAction.js | 8 ++++----
 action/lib/common.js     | 2 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index 30c1445..7d8681d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,11 @@ node_modules/
 .vscode
 action/*.zip
 action/package.json
+
+# Eclipse
+bin/
+**/.project
+.settings/
+.classpath
+.cache-main
+.cache-tests
diff --git a/action/alarmWebAction.js b/action/alarmWebAction.js
index 55a6270..0963ce4 100644
--- a/action/alarmWebAction.js
+++ b/action/alarmWebAction.js
@@ -141,7 +141,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 => {
@@ -188,7 +188,7 @@ function main(params) {
                 resolve({
                     statusCode: 200,
                     headers: {'Content-Type': 'application/json'},
-                    body: new Buffer(JSON.stringify(body)).toString('base64')
+                    body: body
                 });
             })
             .catch(err => {
@@ -300,7 +300,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 => {
@@ -326,7 +326,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 => {
diff --git a/action/lib/common.js b/action/lib/common.js
index 663be12..b2c613e 100644
--- a/action/lib/common.js
+++ b/action/lib/common.js
@@ -100,7 +100,7 @@ function sendError(statusCode, error, message) {
     return {
         statusCode: statusCode,
         headers: { 'Content-Type': 'application/json' },
-        body: new Buffer(JSON.stringify(params)).toString('base64')
+        body: params
     };
 }