Please sign in to comment.
Drastially change how beforeRedirect callbacks work.
Instead of relying on removed event system features, the beforeRedirect callback now works differently. Each callback will receive the original URL that the redirect was for and the response object. Any listener can directly set the location header, statusCode or any other headers they desire. The exit parameter cannot be altered and will most likely be removed in the future as exiting from the controller makes a variety of testing situations harder. This change also simplifies the testing & behavior of the beforeRedirect callback. If a beforeRedirect callback is stopped no redirection occurs as in the past.
- Loading branch information...
Showing with 144 additions and 215 deletions.
- +8 −8 lib/Cake/Controller/Component/RequestHandlerComponent.php
- +9 −10 lib/Cake/Controller/Controller.php
- +78 −78 lib/Cake/Test/TestCase/Controller/Component/AuthComponentTest.php
- +14 −11 lib/Cake/Test/TestCase/Controller/Component/RequestHandlerComponentTest.php
- +34 −107 lib/Cake/Test/TestCase/Controller/ControllerTest.php
- +1 −1 lib/Cake/Test/TestCase/Error/ExceptionRendererTest.php
Oops, something went wrong.