diff --git a/src/ZfrRest/Mvc/Controller/MethodHandler/OptionsHandler.php b/src/ZfrRest/Mvc/Controller/MethodHandler/OptionsHandler.php index 2a3a198..e9c5434 100755 --- a/src/ZfrRest/Mvc/Controller/MethodHandler/OptionsHandler.php +++ b/src/ZfrRest/Mvc/Controller/MethodHandler/OptionsHandler.php @@ -18,7 +18,6 @@ namespace ZfrRest\Mvc\Controller\MethodHandler; -use Zend\Http\Header\Allow; use Zend\Mvc\Controller\AbstractController; use Zend\Stdlib\ResponseInterface; use ZfrRest\Mvc\Controller\MethodHandler\MethodHandlerInterface; @@ -58,11 +57,7 @@ public function handleMethod(AbstractController $controller, ResourceInterface $ $response = $controller->getResponse(); - $allow = new Allow(); - $allow->disallowMethods(array_keys($allow->getAllMethods())); - $allow->allowMethods($allowedMethods); - - $response->getHeaders()->addHeader($allow); + $response->getHeaders()->addHeaderLine('Allow', implode(', ', $allowedMethods)); $response->setContent(''); $response->setStatusCode(200); diff --git a/tests/ZfrRestTest/Mvc/Controller/MethodHandler/OptionsHandlerTest.php b/tests/ZfrRestTest/Mvc/Controller/MethodHandler/OptionsHandlerTest.php index f2f6fe6..07c9689 100644 --- a/tests/ZfrRestTest/Mvc/Controller/MethodHandler/OptionsHandlerTest.php +++ b/tests/ZfrRestTest/Mvc/Controller/MethodHandler/OptionsHandlerTest.php @@ -39,6 +39,7 @@ public function testCanPopulateFromControllerOptionsMethod() $controller->expects($this->once()) ->method('options') + ->with() ->will($this->returnValue(array('options', 'get', 'put'))); $response = new HttpResponse();