You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> request.post({uri: 'invalid'}, function(err, res){ })
/.../node_modules/request/lib/getProxyFromURI.js:5
return hostname.replace(/^\.*/, '.').toLowerCase()
^
TypeError: Cannot read property 'replace' of null
at formatHostname (/.../node_modules/request/lib/getProxyFromURI.js:5:18)
at uriInNoProxy (/.../node_modules/request/lib/getProxyFromURI.js:21:18)
at getProxyFromURI (/.../node_modules/request/lib/getProxyFromURI.js:55:25)
at Request.init (/.../node_modules/request/request.js:447:18)
The URI validation happens on line 457 of request.js, but when NO_PROXY is set in the environment, the hostname is parsed out of the URI before the validation happens. If an invalid URI has no hostname, then the above null error is thrown, which is no good for asynchronous code.
It looks like it'd be possible to move the URI validation above the proxy and tunnel bits, so that the error can be emitted normally.
The text was updated successfully, but these errors were encountered:
simov
added a commit
to simov/request
that referenced
this issue
May 25, 2015
The URI validation happens on line 457 of request.js, but when
NO_PROXY
is set in the environment, the hostname is parsed out of the URI before the validation happens. If an invalid URI has no hostname, then the above null error is thrown, which is no good for asynchronous code.It looks like it'd be possible to move the URI validation above the proxy and tunnel bits, so that the error can be emitted normally.
The text was updated successfully, but these errors were encountered: