added ifttt ip address to whitelist

This commit is contained in:
Martin Donnelly 2018-06-14 08:25:39 +01:00
parent d6fc2c9632
commit 84742640c4

View File

@ -28,7 +28,10 @@ const cache = apicache.middleware;
// app.use(cache('15 minutes')); // app.use(cache('15 minutes'));
const ips = ['212.71.255.44', '82.35.75.161']; const ips = ['212.71.255.44', '82.35.75.161', '54.146.189.113'];
// 54.146.189.113 is for ifttt
const complexUrls = new Map(); const complexUrls = new Map();
@ -156,11 +159,11 @@ function getUrl (req, res) {
logger.debug(response.headers); logger.debug(response.headers);
const tempUrl = new URL(theUrl); const tempUrl = new URL(theUrl);
logger.debug('theUrl:', theUrl); // logger.debug('theUrl:', theUrl);
logger.debug('tempurl:', tempUrl); // logger.debug('tempurl:', tempUrl);
rUrl = new URL(response.headers.location, tempUrl.origin); rUrl = new URL(response.headers.location, tempUrl.origin);
logger.debug(rUrl); logger.debug(rUrl.href);
} }
else else
rUrl = urlparser.parse(response.headers.location); rUrl = urlparser.parse(response.headers.location);