silverstripe/silverstripe-framework — pull request #2145 by tractorcow (2013-06-24 01:46:13+00:00)
Title: Controller::redirect now returns the resulting SS_HTTPResponse

This is quite a minor code usability / style tweak.

Controller::redirect now returns the resulting SS_HTTPResponse.

The main argument for this is that the redirect functionality (Controller::redirect, SS_HTTPResponse::redirect, etc) are used across the codebase as though they return the SS_HTTPResponse object itself, although it doesn't in this case.

It's also odd that in many cases in Controller where `return $this->redirect($url)` is called, the redirect still works fine, giving the impression that it's returning the response back to the Director (it's not actually). If `return $this->redirect($url)` is called during routing (such as with a custom route handler) it doesn't work (this is how I found this).

Basically this just tightens up the visibility of what the code is doing vs what it's actually doing.

Test cases have been run on this btw!