From 0423d33aa88f92f13d71dd016f4eb687a55f597c Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Wed, 13 Jun 2018 23:54:49 +0100 Subject: [PATCH] a little error handling --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 85b5bf1..2256861 100644 --- a/server.js +++ b/server.js @@ -145,7 +145,9 @@ function getUrl (req, res) { logger.debug(response.headers); const tempUrl = new URL(theUrl); - rUrl = URL.parse(`${tempUrl.origin}${response.headers.location}`); + const newURL = `${tempUrl.origin}${response.headers.location}`; + logger.debug('newURL', newURL); + rUrl = URL.parse(newURL); } else rUrl = URL.parse(response.headers.location);