Skip to content

Commit

Permalink
Update Content Type Invoker
Browse files Browse the repository at this point in the history
  • Loading branch information
pentagonal committed Mar 24, 2018
1 parent 767ddb1 commit 289941f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/NotAllowedHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,11 @@ public function __invoke(
): ResponseInterface {
$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);
}

Expand Down

0 comments on commit 289941f

Please sign in to comment.