update Node.js to version 10 (#189)
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 @@
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 @@
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);