Merge pull request #383 from thefosk/master

Fixing a bug that generates an unexpected TypeError
This commit is contained in:
Charlie Robbins 2013-03-17 22:50:17 -07:00
commit ea10bb22d9

View File

@ -268,7 +268,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
delete response.headers['transfer-encoding']; delete response.headers['transfer-encoding'];
} }
if ((response.statusCode === 301) || (response.statusCode === 302) if ((response.statusCode === 301 || response.statusCode === 302)
&& typeof response.headers.location !== 'undefined') { && typeof response.headers.location !== 'undefined') {
location = url.parse(response.headers.location); location = url.parse(response.headers.location);
if (location.host === req.headers.host) { if (location.host === req.headers.host) {