2
0
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:
Samuel Attard
2017-09-10 02:04:00 +10:00
committed by GitHub
parent 07a7b7c84c
commit b01ce193a5
+3 -1
View File
@@ -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) {