1. cherrypy
  2. CherryPy

Commits

Robert Brewer  committed 121e3b0

Might as well keep track of InternalRedirects.

  • Participants
  • Parent commits 2444f62
  • Branches cherrypy

Comments (0)

Files changed (1)

File _cprequest.py

View file
         self.hooks = tools.HookMap(pts)
         self.hooks.failsafe = ['on_start_resource', 'on_end_resource',
                                'on_end_request']
+        self.redirections = []
     
     def close(self):
         if not self.closed:
                     break
                 except cherrypy.InternalRedirect, ir:
                     pi = ir.path
+                    self.redirections.append(pi)
         except (KeyboardInterrupt, SystemExit):
             raise
         except:
                 self.hooks.run('before_finalize')
                 cherrypy.response.finalize()
             except (cherrypy.HTTPRedirect, cherrypy.HTTPError), inst:
-                # For an HTTPRedirect or HTTPError (including NotFound),
-                # we don't go through the regular mechanism:
-                # we return the redirect or error page immediately
                 inst.set_response()
                 self.hooks.run('before_finalize')
                 cherrypy.response.finalize()