mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Fixing the if statement as it lead to 'TypeError: Parameter 'url' must be a string, not undefined' in certain cases
This commit is contained in:
parent
701dc698e3
commit
c9b6895c5e
@ -268,7 +268,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
|
||||
delete response.headers['transfer-encoding'];
|
||||
}
|
||||
|
||||
if ((response.statusCode === 301) || (response.statusCode === 302)
|
||||
if ((response.statusCode === 301 || response.statusCode === 302)
|
||||
&& typeof response.headers.location !== 'undefined') {
|
||||
location = url.parse(response.headers.location);
|
||||
if (location.host === req.headers.host) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user