mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Merge pull request #383 from thefosk/master
Fixing a bug that generates an unexpected TypeError
This commit is contained in:
commit
ea10bb22d9
@ -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