[FIX] do not autocorrect location header in redirects
bzr revid: chs@openerp.com-20120813135927-k32eih6tg6y28ivl
This commit is contained in:
parent
41791f7e2f
commit
0f1aa3300d
|
@ -326,6 +326,7 @@ def make_conditional(req, response, last_modified=None, etag=None):
|
|||
def login_and_redirect(req, db, login, key, redirect_url='/'):
|
||||
req.session.authenticate(db, login, key, {})
|
||||
redirect = werkzeug.utils.redirect(redirect_url, 303)
|
||||
redirect.autocorrect_location_header = False
|
||||
cookie_val = urllib2.quote(simplejson.dumps(req.session_id))
|
||||
redirect.set_cookie('instance0|session_id', cookie_val)
|
||||
return redirect
|
||||
|
|
|
@ -16,4 +16,6 @@ class Mobile(openerpweb.Controller):
|
|||
|
||||
@openerpweb.httprequest
|
||||
def index(self, req):
|
||||
return werkzeug.utils.redirect('/web_mobile/static/src/web_mobile.html', 301)
|
||||
r = werkzeug.utils.redirect('/web_mobile/static/src/web_mobile.html', 301)
|
||||
r.autocorrect_location_header = False
|
||||
return r
|
||||
|
|
Loading…
Reference in New Issue