diff --git a/Slim/Http/Response.php b/Slim/Http/Response.php index 9b5272e64..33a9eda4c 100644 --- a/Slim/Http/Response.php +++ b/Slim/Http/Response.php @@ -359,7 +359,7 @@ public function withJson($data, $status = null, $encodingOptions = 0) throw new \RuntimeException(json_last_error_msg(), json_last_error()); } - $responseWithJson = $response->withHeader('Content-Type', 'application/json;charset=utf-8'); + $responseWithJson = $response->withHeader('Content-Type', 'application/json'); if (isset($status)) { return $responseWithJson->withStatus($status); } diff --git a/tests/Http/ResponseTest.php b/tests/Http/ResponseTest.php index b09fcfc0a..dac4316df 100755 --- a/tests/Http/ResponseTest.php +++ b/tests/Http/ResponseTest.php @@ -292,7 +292,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();