Skip to content

Commit 69ad003

Browse files
authored
fix: if browser support AbortController api , stream-http timeout err (#466)
1 parent 53f1f0c commit 69ad003

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

shims/xhr.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var util = require('util');
44
var urlutil = require('url');
55
var http = require('http');
66
var https = require('https');
7+
var capability = require('stream-http/lib/capability');
78
var debug = require('debug')('urllib');
89
var ms = require('humanize-ms');
910

@@ -146,6 +147,10 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback)
146147
options.requestTimeout = args.timeout;
147148
}
148149

150+
if (capability.abortController) {
151+
options.mode = 'disable-fetch';
152+
}
153+
149154
var sslNames = [
150155
'pfx',
151156
'key',

0 commit comments

Comments
 (0)