[bwcompat] also set response headers in error cases
I had this sitting around in my local copy, I don't remember why I
needed this but it seems correct.
--- a/pyramid_cubicweb/bwcompat.py Mon Feb 29 16:16:33 2016 +0100
+++ b/pyramid_cubicweb/bwcompat.py Wed Nov 25 12:32:59 2015 +0100
@@ -95,15 +95,17 @@
# for this exception) should be enough
# content = self.appli.ajax_error_handler(req, ex)
raise
+ finally:
+ # XXX CubicWebPyramidRequest.headers_out should
+ # access directly the pyramid response headers.
+ request.response.headers.clear()
+ for k, v in req.headers_out.getAllRawHeaders():
+ for item in v:
+ request.response.headers.add(k, item)
+
if content is not None:
request.response.body = content
- # XXX CubicWebPyramidRequest.headers_out should
- # access directly the pyramid response headers.
- request.response.headers.clear()
- for k, v in req.headers_out.getAllRawHeaders():
- for item in v:
- request.response.headers.add(k, item)
except LogOut as ex:
# The actual 'logging out' logic should be in separated function