diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-03-07 18:46:38 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-03-07 18:46:38 +0100 |
| commit | 4aa5ec3fa511e42a08318fe66dde3bd57f0d1f09 (patch) | |
| tree | d3de91d0113164ce313d7eff44c2f25c7e95f743 /addons/web/static/lib | |
| parent | 3c821d4035d0c85f691653c47986d8f4c3dfc51d (diff) | |
| parent | d67b410dfcd67d2540628d4f6be0daf8861c4a46 (diff) | |
[MERGE] forward port branch 11.0 up to d67b410dfcd
Diffstat (limited to 'addons/web/static/lib')
| -rw-r--r-- | addons/web/static/lib/qweb/qweb2.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index c4bb7128e9b..94a0afaa32a 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -358,7 +358,12 @@ QWeb2.Engine = (function() { req.open('GET', s, async); if (async) { req.addEventListener("load", function() { - if (req.status == 200) { + // 0, not being a valid HTTP status code, is used by browsers + // to indicate success for a non-http xhr response + // (for example, using the file:// protocol) + // https://developer.mozilla.org/fr/docs/Web/API/XMLHttpRequest + // https://bugzilla.mozilla.org/show_bug.cgi?id=331610 + if (req.status == 200 || req.status == 0) { callback(null, self._parse_from_request(req)); } else { callback(new Error("Can't load template " + s + ", http status " + req.status)); |
