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:
thefosk 2013-03-14 19:09:03 -07:00
parent 701dc698e3
commit c9b6895c5e

View File

@ -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) {