提交 7f030fab 编写于 作者: R Roman Yakubuk 提交者: GitHub

Fix issue #533

上级 7a692dc5
......@@ -432,15 +432,21 @@
}
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
var body = 'response' in xhr ? xhr.response : xhr.responseText
resolve(new Response(body, options))
setTimeout(function() {
resolve(new Response(body, options));
}, 0);
}
xhr.onerror = function() {
reject(new TypeError('Network request failed'))
setTimeout(function() {
reject(new TypeError('Network request failed'));
}, 0);
}
xhr.ontimeout = function() {
reject(new TypeError('Network request failed'))
setTimeout(function() {
reject(new TypeError('Network request failed'));
}, 0);
}
xhr.open(request.method, request.url, true)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册