[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
This commit is contained in:
parent
0e646fc6ff
commit
edc5a3904f
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue