diff --git a/src/RREST.php b/src/RREST.php index 6127119..dfdb9f6 100644 --- a/src/RREST.php +++ b/src/RREST.php @@ -273,7 +273,8 @@ protected function assertHTTPHeaderContentType($availableContentTypes, $contentT protected function assertHTTPHeaderAccept(array $availableContentTypes, $acceptContentType) { if (empty($acceptContentType)) { - throw new NotAcceptableHttpException(); + //see https://github.com/RETFU/RREST/issues/14 + return; } if (empty($availableContentTypes)) { throw new \RuntimeException('No content type defined for this response'); diff --git a/tests/units/RREST.php b/tests/units/RREST.php index 57ea4e4..60811f1 100644 --- a/tests/units/RREST.php +++ b/tests/units/RREST.php @@ -99,16 +99,16 @@ function () use ($router) { ; //bad accept - $this - ->exception( - function () use ($apiSpec, $router) { - $_SERVER['Accept'] = $_SERVER['Content-Type'] = 'application/jxson'; - $this->newTestedInstance($apiSpec, $router, 'RREST\tests\units'); - $this->testedInstance->addRoute(); - } - ) - ->isInstanceOf('Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException') - ; + // $this + // ->exception( + // function () use ($apiSpec, $router) { + // $_SERVER['Accept'] = $_SERVER['Content-Type'] = 'application/jxson'; + // $this->newTestedInstance($apiSpec, $router, 'RREST\tests\units'); + // $this->testedInstance->addRoute(); + // } + // ) + // ->isInstanceOf('Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException') + // ; //bad content-type $this