Skip to content

Commit

Permalink
fix: if browser support AbortController api , stream-http timeout err (
Browse files Browse the repository at this point in the history
  • Loading branch information
binghaiwang authored May 8, 2018
1 parent 53f1f0c commit 69ad003
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions shims/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var util = require('util');
var urlutil = require('url');
var http = require('http');
var https = require('https');
var capability = require('stream-http/lib/capability');
var debug = require('debug')('urllib');
var ms = require('humanize-ms');

Expand Down Expand Up @@ -146,6 +147,10 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback)
options.requestTimeout = args.timeout;
}

if (capability.abortController) {
options.mode = 'disable-fetch';
}

var sslNames = [
'pfx',
'key',
Expand Down

0 comments on commit 69ad003

Please sign in to comment.