Skip to content

Commit a3653a7

Browse files
duan007aPeterRao
authored andcommitted
fix: fix bug about value of requestTimeout! (#383)
* fix: fix bug about value of requestTimeout! * fix: fix bug about value of requestTimeout!
1 parent 15cd717 commit a3653a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shims/xhr.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ exports.requestWithCallback = function requestWithCallback(url, args, callback)
140140
lookup: args.lookup,
141141
};
142142

143-
if (args.timeout) {
143+
if (Array.isArray(args.timeout)) {
144+
options.requestTimeout = args.timeout[args.timeout.length - 1];
145+
} else if (typeof args.timeout !== 'undefined') {
144146
options.requestTimeout = args.timeout;
145147
}
146148

0 commit comments

Comments
 (0)