mirror of
https://github.com/tenrok/axios.git
synced 2026-05-24 14:04:14 +03:00
Allow overriding the used transport
This allows users of axios inside `electron` to provide the [`net`](https://electron.atom.io/docs/api/net/) module as the http transport instead of using nodes http/https modules. This gives a whole bunch of things to Electron users including automatic proxy resolution.
This commit is contained in:
@@ -117,7 +117,9 @@ module.exports = function httpAdapter(config) {
|
||||
}
|
||||
|
||||
var transport;
|
||||
if (config.maxRedirects === 0) {
|
||||
if (config.transport) {
|
||||
transport = config.transport;
|
||||
} else if (config.maxRedirects === 0) {
|
||||
transport = isHttps ? https : http;
|
||||
} else {
|
||||
if (config.maxRedirects) {
|
||||
|
||||
Reference in New Issue
Block a user