diff --git a/src/Application/Application.php b/src/Application/Application.php index a1b2df0..c9ec949 100644 --- a/src/Application/Application.php +++ b/src/Application/Application.php @@ -11,6 +11,10 @@ class Application implements IApplication { + private const UNIQUE_HEADERS = [ + 'content-type', + ]; + /** @var IDispatcher */ private $dispatcher; @@ -41,8 +45,9 @@ public function runWith(ApiRequest $request): void header($httpHeader, true, $response->getStatusCode()); foreach ($response->getHeaders() as $name => $values) { + $replace = in_array(strtolower($name), self::UNIQUE_HEADERS, true) ? true : false; foreach ($values as $value) { - header(sprintf('%s: %s', $name, $value), false); + header(sprintf('%s: %s', $name, $value), $replace); } }