未验证 提交 a900d7d0 编写于 作者: T Thomas Grainger 提交者: GitHub

work around IE XHR bug with '' URL Fixes #618 (#619)

Co-authored-by: NJake Champion <me@jakechampion.name>
上级 92d78dfe
......@@ -486,7 +486,15 @@ export function fetch(input, init) {
reject(new DOMException('Aborted', 'AbortError'))
}
xhr.open(request.method, request.url, true)
function fixUrl(url) {
try {
return url === '' && self.location.href ? self.location.href : url
} catch (e) {
return url
}
}
xhr.open(request.method, fixUrl(request.url), true)
if (request.credentials === 'include') {
xhr.withCredentials = true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册