@@ -76,11 +76,11 @@ function requestWithRedirects(url, maxRedirects, failure, success)
77 var redirectUrl = new URL(response.headers['location'], new URL(url).origin).href;
77 var redirectUrl = new URL(response.headers['location'], new URL(url).origin).href;
79− if (typeof redirectPath === 'string' && response.statusCode >= 300 && response.statusCode < 400)
79+ if (typeof redirectUrl === 'string' && response.statusCode >= 300 && response.statusCode < 400)
81 return (maxRedirects <= 0)
81 return (maxRedirects <= 0)
82 ? failure(new Error('followed 10 redirects and gave up'))
82 ? failure(new Error('followed 10 redirects and gave up'))
83− : requestWithRedirects(redirectPath, maxRedirects - 1, failure, success);
83+ : requestWithRedirects(redirectUrl, maxRedirects - 1, failure, success);