diff --git a/app/Articles/Application/Listener.php b/app/Articles/Application/Listener.php index 14e9f2d..d9a5be1 100644 --- a/app/Articles/Application/Listener.php +++ b/app/Articles/Application/Listener.php @@ -57,16 +57,6 @@ public function __invoke(ReactiveRequest $request, ReactiveResponse $response) ])); } - //handle the request content type header - if (in_array($this->request->getMethod(), ['POST', 'PUT', 'PATCH'])) { - if (in_array('Content-Type', $this->request->getHeaders()) - && $this->request->getHeaders()['Content-Type'] !== 'application/json' - ) { - $this->response->writeHead(415); - return $this->response->end(); - } - } - $routeTo = function ($service) { return $service(); }; diff --git a/tests/api/Create/ArticleWithUsupportedMediaTypeCept.php b/tests/api/Create/ArticleWithUsupportedMediaTypeCept.php deleted file mode 100644 index 6654ae2..0000000 --- a/tests/api/Create/ArticleWithUsupportedMediaTypeCept.php +++ /dev/null @@ -1,7 +0,0 @@ -wantTo('create a article via API using unsupported media type'); -$I->haveHttpHeader('Content-Type', 'application/NOT-JSON'); -$I->sendPOST('/articles', ['title' => 'test', 'content' => ['test'=>'content']]); -$I->seeResponseCodeIs(415); -