From 767ddb193f26fa985f04055999c2375809a45874 Mon Sep 17 00:00:00 2001 From: Pentagonal Date: Sat, 24 Mar 2018 20:00:03 +0700 Subject: [PATCH] Update Content Type Invoker --- src/ResponseErrorAbstract.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ResponseErrorAbstract.php b/src/ResponseErrorAbstract.php index c9e76be..d5f8613 100644 --- a/src/ResponseErrorAbstract.php +++ b/src/ResponseErrorAbstract.php @@ -261,9 +261,11 @@ protected function generateOutputHandler( $contentType = $this->getContentType(); // if content type has not been set - // get it from Request + // get it from Request / Response if (!$contentType) { - $contentType = $request->getHeaderLine('Content-Type')?: static::DEFAULT_CONTENT_TYPE; + $contentType = $response->getHeaderLine('Content-Type')?: ( + $request->getHeaderLine('Content-Type')?: static::DEFAULT_CONTENT_TYPE + ); $this->setContentType($contentType); }