From 87adeac143e78f72501a81353d91a01d18e157fa Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 25 May 2015 17:12:52 -0400 Subject: [PATCH] The default behavior for RestAction should be to error METHOD_NOT_ALLOWED. --- http/rest_action.php | 27 +++++++++++++++++++++------ testing/tests/http/fixtures.php | 4 ---- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/http/rest_action.php b/http/rest_action.php index 35c5191..b3d2c5d 100644 --- a/http/rest_action.php +++ b/http/rest_action.php @@ -1,11 +1,11 @@ controller()->StopWithCode(ResponseCode::METHOD_NOT_ALLOWED); + } + + public function DoPost(Request $request, Response $response) + { + $this->controller()->StopWithCode(ResponseCode::METHOD_NOT_ALLOWED); + } + + public function DoDelete(Request $request, Response $response) + { + $this->controller()->StopWithCode(ResponseCode::METHOD_NOT_ALLOWED); + } + + public function DoPut(Request $request, Response $response) + { + $this->controller()->StopWithCode(ResponseCode::METHOD_NOT_ALLOWED); + } } diff --git a/testing/tests/http/fixtures.php b/testing/tests/http/fixtures.php index fcd3082..20dff31 100644 --- a/testing/tests/http/fixtures.php +++ b/testing/tests/http/fixtures.php @@ -26,22 +26,18 @@ class TestRestAction extends \hoplite\http\RestAction public function DoGet(http\Request $request, http\Response $response) { - parent::DoGet($request, $response); $this->did_get = TRUE; } public function DoPost(http\Request $request, http\Response $response) { - parent::DoPost($request, $response); $this->did_post = TRUE; } public function DoDelete(http\Request $request, http\Response $response) { - parent::DoDelete($request, $response); $this->did_delete = TRUE; } public function DoPut(http\Request $request, http\Response $response) { - parent::DoPut($request, $response); $this->did_put = TRUE; } } -- 2.43.5