Issue #937 new

Collapse redundant hooks

Robert Brewer
created an issue

=== Order of filters in CherryPy 2 ===

  • on_start_resource processHeaders()
  • before_request_body processBody()
  • before_main main(), which included controller lookup
  • before_finalize finalize()
  • on_end_resource

=== Order of hooks in CherryPy 3: ===

process_headers()br get_resource(), which looks up the controller * on_start_resource * before_request_body process_body() * before_handler handler() * before_finalize finalize() * on_end_resource

IMO, it would be good to get rid of the 'before_request_body' hookpoint altogether, and move the builtin tools to use 'on_start_resource' instead.

We could ease migration by having the next version of CP move hooks from before_request_body to on_start_resource (with a !DeprecationWarning), and adding 100 to their priority so they all run in the same order but after all the ones explicitly set at on_start_resource.

Comments (1)

  1. Log in to comment