a little error handling

This commit is contained in:
Martin Donnelly 2018-06-13 23:59:46 +01:00
parent e38257ece5
commit 53874d91f0

View File

@ -29,7 +29,7 @@ const cache = apicache.middleware;
const ips = ['212.71.255.44', '82.35.75.161'];
// app.use(ipfilter(ips, { 'mode': 'allow' }));
app.use(ipfilter(ips, { 'mode': 'allow' }));
app.use((err, req, res, _next) => {
console.log('Error handler', err);
@ -145,6 +145,7 @@ function getUrl (req, res) {
logger.debug(response.headers);
const tempUrl = URL.parse(theUrl);
logger.debug('tempurl:', tempUrl);
const newURL = `${tempUrl.origin}${response.headers.location}`;
logger.debug('newURL', newURL);
rUrl = URL.parse(newURL);