From ca6688b2042c0b20abd08cfcc228511b8edac160 Mon Sep 17 00:00:00 2001 From: Steven Marusa Date: Mon, 4 Oct 2021 20:39:38 -0400 Subject: [PATCH] fix --- index.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/index.js b/index.js index 52c7d99..fb76e55 100644 --- a/index.js +++ b/index.js @@ -367,14 +367,7 @@ RedirectableRequest.prototype._processResponse = function (response) { // If the redirect is relative, carry over the host of the last request from host header var previousHostUrl = !url.parse(location).host ? - url.format({ - protocol: currentUrlParts.protocol, - auth: currentUrlParts.auth, - host: previousHost, - pathname: currentUrlParts.pathname, - search: currentUrlParts.search, - hash: currentUrlParts.hash, - }) : + url.format(Object.assign({}, currentUrlParts, { host: previousHost })) : this._currentUrl; // Create the redirected request