diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2019-03-22 16:39:13 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2019-03-22 16:51:09 +0000 |
| commit | ad826f56ba49caba0881a40609083cf73250d610 (patch) | |
| tree | 7be626f4387098569bcf04604988c20cd74fc26a | |
| parent | 5324284f560dd15ef949dab3b00d238a3bfa2b5e (diff) | |
[FIX] http_routing: ignore # when checking multilang URL
With 953a693df when a route is not found we assume it is a website.page
that can be multilang.
But with #31792 we should once again prefix URL by the language if
necessary.
The combination of the two cause issue when an url like `/web#home` is
tested since we do not take `#` into account, we check if the route is
multilang but no route `/web#home` is found => so we get
`/fr_FR/web#home`.
With this fix, `#fragment` is not taken into account when searching
route.
related to #31792
related to opw-1922051
closes #32059
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
| -rw-r--r-- | addons/http_routing/models/ir_http.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/http_routing/models/ir_http.py b/addons/http_routing/models/ir_http.py index 0129bc90e6d..c7232768d82 100644 --- a/addons/http_routing/models/ir_http.py +++ b/addons/http_routing/models/ir_http.py @@ -164,7 +164,7 @@ def is_multilang_url(local_url, langs=None): local_url = '/'.join(spath) try: # Try to match an endpoint in werkzeug's routing table - url = local_url.split('?') + url = local_url.partition('#')[0].split('?') path = url[0] query_string = url[1] if len(url) > 1 else None router = request.httprequest.app.get_db_router(request.db).bind('') |
