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 the fix of #31792 we should once again test that all relative URL on
the website are multilang or not so an url like `/web#home` that was
considered not multilang before (because there is no route /web#home)
now is considered multilang.

With this fix, we only ignore the hash mark and URL fragment when
finding the URL's route (so we find that /web is not multilang).

related to #31792
related to opw-1922051
closes #32059
  • Loading branch information...
nle-odoo committed Mar 22, 2019
1 parent 3a0bedd commit 3760d624689c1ede73702b2dfd2b3850591df653
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 3760d62

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