Skip to content

Commit

Permalink
Remove ; charset=utf-8 from Response::withJson()
Browse files Browse the repository at this point in the history
  • Loading branch information
chadicus committed Apr 15, 2019
1 parent f0718f6 commit c311bf2
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 c311bf2

Please sign in to comment.