diff options
| author | Olivier Dony <odo@openerp.com> | 2015-05-05 10:12:20 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2015-05-05 10:12:22 +0200 |
| commit | c667eb06b8de63e2567a18521dff125516a88d32 (patch) | |
| tree | f4bac24e891bc28d31a88f54c9780fc5addb7e4e /addons/web/static/src/xml | |
| parent | ce32867a90bdc56b529db9f6c7cceef0d93b66e0 (diff) | |
[FIX] website: only consider valid languages in URL path
Improves aea358ca67f88fa3fb13ac2766c5195223551d10 and avoid spurious
redirects for URLs that do not match a controller but do not
have a valid language.
When the URL does not match any controller, the language
matcher tried to strip the leading path component, treating
it as a language code. For example:
/fr_BE/page/homepage
would not match any route, so it would be rerouted internally
as /page/homepage, after setting `request.lang` to fr_BE.
This breaks the magical 404 handler that allows ir.attachment
entries to be mapped to static URLs. Due to the internal rerouting,
the mapping of e.g. /website_mycompany/static/src/image/logo.png
would be rerouted to /static/src/image/logo.png and not match
the mapped URL anymore.
Now the stripping of the path component will only occur if
that path component matches an installed language code.
The consequence is that URLs containing uninstalled language codes
will now lead to 404 errors - an acceptable trade-off (e.g.
when an older version of the website is still indexed by a search
engine)
Diffstat (limited to 'addons/web/static/src/xml')
0 files changed, 0 insertions, 0 deletions
