Skip to content

Commit

Permalink
if url starts with file: fallback to xhr, fixes #100
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Nov 1, 2022
1 parent 5377aa0 commit 4670bef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion i18nextHttpBackend.js
Expand Up @@ -350,7 +350,7 @@ var request = function request(options, url, payload, callback) {
payload = undefined;
}
callback = callback || function () {};
if (fetchApi) {
if (fetchApi && url.indexOf('file:') !== 0) {
return requestWithFetch(options, url, payload, callback);
}
if ((0, _utils.hasXMLHttpRequest)() || typeof ActiveXObject === 'function') {
Expand Down
2 changes: 1 addition & 1 deletion i18nextHttpBackend.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/request.js
Expand Up @@ -138,7 +138,7 @@ const request = (options, url, payload, callback) => {
}
callback = callback || (() => {})

if (fetchApi) {
if (fetchApi && url.indexOf('file:') !== 0) {
// use fetch api
return requestWithFetch(options, url, payload, callback)
}
Expand Down

0 comments on commit 4670bef

Please sign in to comment.