You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/12/12 18:36:12 UTC
[GitHub] csantanapr closed pull request #189: update Node.js to version 10
csantanapr closed pull request #189: update Node.js to version 10
URL: https://github.com/apache/incubator-openwhisk-package-cloudant/pull/189
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/Dockerfile b/Dockerfile
index 9a4c6d7..57f8728 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM node:8.14.0
+FROM node:10.14.0
# only package.json
ADD package.json /
diff --git a/provider/lib/authHandler.js b/provider/lib/authHandler.js
index 9e25242..5c6be15 100644
--- a/provider/lib/authHandler.js
+++ b/provider/lib/authHandler.js
@@ -1,11 +1,11 @@
-function handleAuth(triggerData) {
+function handleAuth(triggerData, options) {
var auth = triggerData.apikey.split(':');
- return Promise.resolve({
+ options.auth = {
user: auth[0],
pass: auth[1]
- });
-
+ };
+ return Promise.resolve(options);
}
module.exports = {
diff --git a/provider/lib/utils.js b/provider/lib/utils.js
index c863d74..214c6e5 100644
--- a/provider/lib/utils.js
+++ b/provider/lib/utils.js
@@ -242,13 +242,7 @@ module.exports = function(logger, triggerDB, redisClient) {
json: form
}, function(error, response) {
try {
- var statusCode;
- if (!error) {
- statusCode = response.statusCode;
- }
- else if (error.statusCode) {
- statusCode = error.statusCode;
- }
+ var statusCode = !error ? response.statusCode : error.statusCode;
logger.info(method, triggerData.id, 'http post request, STATUS:', statusCode);
if (error || statusCode >= 400) {
// only manage trigger fires if they are not infinite
@@ -512,10 +506,9 @@ module.exports = function(logger, triggerDB, redisClient) {
this.authRequest = function(triggerData, options, cb) {
var method = 'authRequest';
- authHandler.handleAuth(triggerData)
- .then(auth => {
- options.auth = auth;
- request(options, cb);
+ authHandler.handleAuth(triggerData, options)
+ .then(requestOptions => {
+ request(requestOptions, cb);
})
.catch(err => {
logger.error(method, err);
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services