diff --git a/src/Response.php b/src/Response.php index e298b18..750009e 100644 --- a/src/Response.php +++ b/src/Response.php @@ -194,7 +194,7 @@ public function withJson($data, ?int $status = null, int $options = 0, int $dept } $response = $this->response - ->withHeader('Content-Type', 'application/json;charset=utf-8') + ->withHeader('Content-Type', 'application/json') ->withBody($this->streamFactory->createStream($json)); if ($status !== null) { diff --git a/tests/ResponseTest.php b/tests/ResponseTest.php index ed99fc3..dfa7748 100644 --- a/tests/ResponseTest.php +++ b/tests/ResponseTest.php @@ -607,7 +607,7 @@ public function testWithJson() $this->assertNotEquals($response->getStatusCode(), $originalResponse->getStatusCode()); $this->assertEquals(201, $response->getStatusCode()); - $this->assertEquals('application/json;charset=utf-8', $response->getHeaderLine('Content-Type')); + $this->assertEquals('application/json', $response->getHeaderLine('Content-Type')); $body = $response->getBody(); $body->rewind();