Skip to content

Commit

Permalink
Allow overriding the used transport
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MarshallOfSound committed Sep 9, 2017
1 parent 07a7b7c commit b01ce19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/adapters/http.js
Expand Up @@ -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) {
Expand Down

0 comments on commit b01ce19

Please sign in to comment.