Skip to content
Permalink
Browse files

[FIX] http_routing: ignore # when checking multilang URL

With 953a693 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
  • Loading branch information...
nle-odoo committed Mar 22, 2019
1 parent 3a0bedd commit 2689704207e58d73c8096c79e8acfce67005a07c
Showing with 1 addition and 1 deletion.
  1. +1 −1 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('')

0 comments on commit 2689704

Please sign in to comment.
You can’t perform that action at this time.