Skip to content

Commit

Permalink
Fixes #12 - handles URL internally without throwing exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Darren-Lee Joseph authored and Darren-Lee Joseph committed Oct 15, 2015
1 parent 891f3f6 commit d3733b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions code/MaintenanceModeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class MaintenanceMode_Page_ControllerExtension extends Extension {
private static $allowed_ips = array();

/**
* @throws SS_HTTPResponse_Exception
* @return SS_HTTPResponse
*/
public function onBeforeInit() {
Expand Down Expand Up @@ -66,7 +65,9 @@ public function onBeforeInit() {
// (instead of redirecting to our maintenance page's URL).
$controller = ModelAsController::controller_for($utilityPage);
$response = $controller->handleRequest(new SS_HTTPRequest("GET", "/"), new DataModel());
throw new SS_HTTPResponse_Exception($response, $response->getStatusCode());
HTTP::add_cache_headers($response);
$response->output();
die();
}

/**
Expand Down

0 comments on commit d3733b2

Please sign in to comment.