summaryrefslogtreecommitdiff
path: root/addons/base
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-09-02 12:49:20 +0200
committerXavier Morel <xmo@openerp.com>2011-09-02 12:49:20 +0200
commitedc5a3904fd983a8d0a27fbd4e07eda914169cbc (patch)
treeb45236e5082f168a01ddc9620f7a3f70f649ff06 /addons/base
parent0e646fc6ff9cf4526410fddaf508c7153d1cf3ce (diff)
[IMP] check if handler returned a response already: just wrap return value if it's a string, otherwise let it through as is
bzr revid: xmo@openerp.com-20110902104920-c0cpwmg62y70tx1b
Diffstat (limited to 'addons/base')
-rw-r--r--addons/base/common/dispatch.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/base/common/dispatch.py b/addons/base/common/dispatch.py
index 3f35a09f7fa..2d1611e1731 100644
--- a/addons/base/common/dispatch.py
+++ b/addons/base/common/dispatch.py
@@ -253,12 +253,12 @@ class Root(object):
result = handler(
request, self.config)
- if isinstance(result, werkzeug.wrappers.Response):
- response = result
- else:
+ if isinstance(result, basestring):
response = werkzeug.wrappers.Response(
result, headers=[('Content-Type', 'text/html; charset=utf-8'),
('Content-Length', len(result))])
+ else:
+ response = result
response.set_cookie(self.session_cookie, session.sid)