jasonpet closed pull request #156: remove the use of base64 for webaction
response
URL: https://github.com/apache/incubator-openwhisk-package-alarms/pull/156
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
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
};
}
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services