Skip to content

Commit c9b6895

Browse files
committed
Fixing the if statement as it lead to 'TypeError: Parameter 'url' must be a string, not undefined' in certain cases
1 parent 701dc69 commit c9b6895

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/node-http-proxy/http-proxy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
268268
delete response.headers['transfer-encoding'];
269269
}
270270

271-
if ((response.statusCode === 301) || (response.statusCode === 302)
271+
if ((response.statusCode === 301 || response.statusCode === 302)
272272
&& typeof response.headers.location !== 'undefined') {
273273
location = url.parse(response.headers.location);
274274
if (location.host === req.headers.host) {

0 commit comments

Comments
 (0)