Skip to content

Commit

Permalink
Fixing interpretation of no_proxy by checking correct hostname
Browse files Browse the repository at this point in the history
as suggested by #434
  • Loading branch information
inthemill committed Jul 20, 2017
1 parent ed47ef8 commit 24ecb51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/adapters/http.js
Expand Up @@ -116,7 +116,7 @@ module.exports = function httpAdapter(config) {
password: proxyUrlAuth[1]
};
}
if (isANoProxyHost(proxy.host)) {
if (isANoProxyHost(parsed.hostname)) {
proxy = undefined;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/adapters/http.js
Expand Up @@ -382,7 +382,7 @@ module.exports = {
});
}).listen(4000, function() {
// set the env variable
process.env.http_proxy = 'http://localhost:4000/';
process.env.http_proxy = 'http://127.0.0.1:4000/';
process.env.no_proxy = 'localhost';

axios.get('http://localhost:4444/').then(function(res) {
Expand Down

0 comments on commit 24ecb51

Please sign in to comment.