From 2e534898fae5c624bdc48be04388a8dd884e88a1 Mon Sep 17 00:00:00 2001 From: Daniel Opitz Date: Fri, 15 Nov 2019 01:40:11 +0100 Subject: [PATCH 1/2] Remove charset on json content-type --- src/Response.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { From 85918cba901d0a88b6bcfef2af2e8ae167fd8343 Mon Sep 17 00:00:00 2001 From: Daniel Opitz Date: Fri, 15 Nov 2019 01:57:55 +0100 Subject: [PATCH 2/2] Remove charset on json content-type --- tests/ResponseTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();