From eaa3682bb609dc69a5499f2c223da479d0d9697b Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 14 Jun 2017 16:45:00 +0200 Subject: [PATCH] [FIX] http: force protocol when missing in URL --- odoo/http.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odoo/http.py b/odoo/http.py index cef63e8f639..94ec3b8c752 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -163,6 +163,8 @@ def redirect_with_hash(url, code=303): # See extensive test page at http://greenbytes.de/tech/tc/httpredirects/ if request.httprequest.user_agent.browser in ('firefox',): return werkzeug.utils.redirect(url, code) + if urlparse.urlparse(url, scheme='http').scheme not in ('http', 'https'): + url = 'http://' + url url = url.replace("'", "%27").replace("<", "%3C") return "" % url