diff --git a/addons/http_routing/models/ir_http.py b/addons/http_routing/models/ir_http.py index 571f47918a0..fd7fde19d75 100644 --- a/addons/http_routing/models/ir_http.py +++ b/addons/http_routing/models/ir_http.py @@ -427,8 +427,12 @@ class IrHttp(models.AbstractModel): request.is_frontend = func.routing.get('website', False) except werkzeug.exceptions.NotFound as e: # either we have a language prefixed route, either a real 404 - # in all cases, website processes them - request.is_frontend = True + # in all cases, website processes them exept if second element is static + # Checking static will avoid to generate an expensive 404 web page since + # most of the time the browser is loading and inexisting assets or image. A standard 404 is enough. + # Earlier check would be difficult since we don't want to break data modules + path_components = request.httprequest.path.split('/') + request.is_frontend = len(path_components) < 3 or path_components[2] != 'static' or not '.' in path_components[-1] routing_error = e request.is_frontend_multilang = not func or (func and request.is_frontend and func.routing.get('multilang', func.routing['type'] == 'http')) diff --git a/addons/web/static/tests/chrome/action_manager_tests.js b/addons/web/static/tests/chrome/action_manager_tests.js index af214a26203..226c8fb2b15 100644 --- a/addons/web/static/tests/chrome/action_manager_tests.js +++ b/addons/web/static/tests/chrome/action_manager_tests.js @@ -2190,7 +2190,8 @@ QUnit.module('ActionManager', { start: function () { var self = this; return this._super.apply(this, arguments).then(function () { - self.iframe.src = 'test ' + self.iframe.getAttribute('src'); + self._rpc({route: self.iframe.getAttribute('src')}); + self.iframe.setAttribute('src', 'about:blank'); }); } }); @@ -2212,7 +2213,7 @@ QUnit.module('ActionManager', { if (route === '/report/check_wkhtmltopdf') { return Promise.resolve('broken'); } - if (route === 'test /report/html/some_report') { + if (route === '/report/html/some_report') { return Promise.resolve(); } return this._super.apply(this, arguments); @@ -2233,7 +2234,7 @@ QUnit.module('ActionManager', { '/web/action/load', '/report/check_wkhtmltopdf', 'warning', - 'test /report/html/some_report', // report client action's iframe + '/report/html/some_report', // report client action's iframe ]); actionManager.destroy(); diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index ef9a9433ce7..de6d88cbbba 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -253,7 +253,8 @@ class Http(models.AbstractModel): parent = super(Http, cls)._serve_fallback(exception) if parent: # attachment return parent - + if not request.is_frontend: + return False website_page = cls._serve_page() if website_page: return website_page