Open nathggns opened 11 years ago
Okay, this needs to change because HEAD requests are equivalent (logic wise) to GET requests, you just don't send back the body.
Controller::head
should implement this, so it's possible for the child controller to do custom things in the HEAD request.
This is obviously a routing issue, thus should and can be solved with a simple route.
A new route shall be assigned to the default router service object, that simply accepts all HEAD requests, executes the corresponding GET method in the controller, uses it's return value, the response object, and prevents the response from sending automatically (see the associated hook in the default router service) and instead sends just the headers with Response::send_headers()
.
This way, no class has to be changed, custom HEAD routes can easily override the default one or this behaviour can be disabled completely by removing the default HEAD route, respectively by using a custom router service.
It wouldn't be as easy as just implementing the method in the sub controller though — Nathaniel Higgins http://nath.is
On Wed, May 29, 2013 at 7:52 PM, Claudio Albertin notifications@github.com wrote:
This is obviously a routing issue, thus should and can be solved with a simple route. A new route shall be assigned to the default router service object, that simply accepts all HEAD requests, executes the corresponding GET method in the controller, uses it's return value, the response object, and prevents the response from sending automatically (see the associated hook in the default router service) and instead sends just the headers with
Response::send_headers()
.This way, no class has to be changed, custom HEAD routes can easily override the default one or this behaviour can be removed completely by removing the default HEAD route respectively use a custom router service.
Reply to this email directly or view it on GitHub: https://github.com/Scaffold/Scaffold/issues/121#issuecomment-18638012
It would be even easier.
Will be implemented and ready on the 8th of June.
Yes. (See https://github.com/Scaffold/Scaffold/blob/development/system/classes/router.php)