mirror of
https://github.com/tenrok/axios.git
synced 2026-06-14 18:42:33 +03:00
Adding a way to disable all proxy processing (#691)
* Adding a way to disable all proxy processing When the proxy field in configuration is === false all proxy processing is disabled. This specifically disable the 'http_proxy' environment variable handling. Fixes #635 Related to #434 * Change readme wording From review comment on PR (#691)
This commit is contained in:
committed by
Rubén Norte
parent
62db26b588
commit
07a7b7c84c
@@ -311,6 +311,23 @@ module.exports = {
|
||||
});
|
||||
},
|
||||
|
||||
testHTTPProxyDisabled: function(test) {
|
||||
// set the env variable
|
||||
process.env.http_proxy = 'http://does-not-exists.example.com:4242/';
|
||||
|
||||
server = http.createServer(function(req, res) {
|
||||
res.setHeader('Content-Type', 'text/html; charset=UTF-8');
|
||||
res.end('123456789');
|
||||
}).listen(4444, function() {
|
||||
axios.get('http://localhost:4444/', {
|
||||
proxy: false
|
||||
}).then(function(res) {
|
||||
test.equal(res.data, '123456789', 'should not pass through proxy');
|
||||
test.done();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
testHTTPProxyEnv: function(test) {
|
||||
server = http.createServer(function(req, res) {
|
||||
res.setHeader('Content-Type', 'text/html; charset=UTF-8');
|
||||
|
||||
Reference in New Issue
Block a user