pyramid_cubicweb/bwcompat.py
changeset 11607 5b36399b6b21
parent 11588 50e1fda83837
child 11608 259fa3391c7b
equal deleted inserted replaced
11606:e245680acce3 11607:5b36399b6b21
    93             except cubicweb.web.RemoteCallFailed as ex:
    93             except cubicweb.web.RemoteCallFailed as ex:
    94                 # XXX The default pyramid error handler (or one that we provide
    94                 # XXX The default pyramid error handler (or one that we provide
    95                 # for this exception) should be enough
    95                 # for this exception) should be enough
    96                 # content = self.appli.ajax_error_handler(req, ex)
    96                 # content = self.appli.ajax_error_handler(req, ex)
    97                 raise
    97                 raise
       
    98             finally:
       
    99                 # XXX CubicWebPyramidRequest.headers_out should
       
   100                 # access directly the pyramid response headers.
       
   101                 request.response.headers.clear()
       
   102                 for k, v in req.headers_out.getAllRawHeaders():
       
   103                     for item in v:
       
   104                         request.response.headers.add(k, item)
       
   105 
    98             if content is not None:
   106             if content is not None:
    99                 request.response.body = content
   107                 request.response.body = content
   100 
   108 
   101             # XXX CubicWebPyramidRequest.headers_out should
       
   102             # access directly the pyramid response headers.
       
   103             request.response.headers.clear()
       
   104             for k, v in req.headers_out.getAllRawHeaders():
       
   105                 for item in v:
       
   106                     request.response.headers.add(k, item)
       
   107 
   109 
   108         except LogOut as ex:
   110         except LogOut as ex:
   109             # The actual 'logging out' logic should be in separated function
   111             # The actual 'logging out' logic should be in separated function
   110             # that is accessible by the pyramid views
   112             # that is accessible by the pyramid views
   111             headers = security.forget(request)
   113             headers = security.forget(request)