summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-06-19 12:03:17 +0000
committerXavier Morel <xmo@odoo.com>2020-06-19 13:05:11 +0000
commit630beba02eac72626e4bea1c0f4d81e17c2fec3e (patch)
tree34d95d292f9a25056df032d5ecfb37ac457edb40 /addons
parent4c7d54a7bf8e9cac8101db5978bde193cd930146 (diff)
[FIX] website_links: incorrect uses of redirect
Until Werkzeug 0.14, redirect() would resolve all URLs to absolute paths or even absolute URL, because relative paths were not valid according to the HTTP RFCs (though most browsers supported them). However RFC 7231 allows them, so Werkzeug 0.15 removes this rewrite on URLs, and `redirect('foo/bar')` now redirects *relative to the current URL* instead of the old `/foo/bar`. If `code` is not found, the link tracker loops on the current URL (`/r/{code}`) instead of redirecting to `/` as was intended. Going through uses of redirect() this seems to be the only problematic call site left, others either use absolute paths or they use URLs coming from the outside. Task 2254691 closes odoo/odoo#53327 X-original-commit: 3a6e079e54a6f973cfc96995a84a7fabff803f1c Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/website_links/controller/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_links/controller/main.py b/addons/website_links/controller/main.py
index 35eac514391..b90c63a1a0e 100644
--- a/addons/website_links/controller/main.py
+++ b/addons/website_links/controller/main.py
@@ -38,4 +38,4 @@ class WebsiteUrl(http.Controller):
if code:
return request.render("website_links.graphs", code.link_id.read()[0])
else:
- return werkzeug.utils.redirect('', 301)
+ return werkzeug.utils.redirect('/', 301)