Skip to content

Commit

Permalink
Fixing the if statement as it lead to 'TypeError: Parameter 'url' mus…
Browse files Browse the repository at this point in the history
…t be a string, not undefined' in certain cases
  • Loading branch information
subnetmarco committed Mar 15, 2013
1 parent 701dc69 commit c9b6895
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/node-http-proxy/http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c9b6895

Please sign in to comment.