web/application.py
changeset 8469 82272decfa99
parent 8466 92c668170ef9
child 8470 a85e107947e6
equal deleted inserted replaced
8464:895e34d9ae0d 8469:82272decfa99
     1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
   403                 # do not overwrite it. This is used by LogOut Except
   403                 # do not overwrite it. This is used by LogOut Except
   404                 # XXX ensure we don't actually serve content
   404                 # XXX ensure we don't actually serve content
   405                 if not content:
   405                 if not content:
   406                     content = self.need_login_content(req)
   406                     content = self.need_login_content(req)
   407         return content
   407         return content
   408 
       
   409 
       
   410 
   408 
   411     def core_handle(self, req, path):
   409     def core_handle(self, req, path):
   412         """method called by the main publisher to process <path>
   410         """method called by the main publisher to process <path>
   413 
   411 
   414         should return a string containing the resulting page or raise a
   412         should return a string containing the resulting page or raise a
   522             return ''
   520             return ''
   523         return self.error_handler(req, ex, tb=False)
   521         return self.error_handler(req, ex, tb=False)
   524 
   522 
   525     def error_handler(self, req, ex, tb=False):
   523     def error_handler(self, req, ex, tb=False):
   526         excinfo = sys.exc_info()
   524         excinfo = sys.exc_info()
   527         self.exception(repr(ex))
   525         if tb:
       
   526             self.exception(repr(ex))
   528         req.set_header('Cache-Control', 'no-cache')
   527         req.set_header('Cache-Control', 'no-cache')
   529         req.remove_header('Etag')
   528         req.remove_header('Etag')
   530         req.reset_message()
   529         req.reset_message()
   531         req.reset_headers()
   530         req.reset_headers()
   532         if req.ajax_request:
   531         if req.ajax_request: