Skip to content

Commit

Permalink
Merge pull request #2630 from chadicus/issue2629
Browse files Browse the repository at this point in the history
Remove `; charset=utf-8` from Response::withJson()

Closes #2629
  • Loading branch information
l0gicgate committed Apr 15, 2019
2 parents f0718f6 + c311bf2 commit 9e1e727
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Slim/Http/Response.php
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Http/ResponseTest.php
Expand Up @@ -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();
Expand Down

0 comments on commit 9e1e727

Please sign in to comment.