[HttpFoundation] status 201 is allowed to have a body

This commit is contained in:
Tobias Schultze 2014-04-16 17:58:23 +02:00
parent e96b018805
commit 1761f64023
2 changed files with 2 additions and 2 deletions

View File

@ -1182,7 +1182,7 @@ class Response
*/
public function isEmpty()
{
return in_array($this->statusCode, array(201, 204, 304));
return in_array($this->statusCode, array(204, 304));
}
/**

View File

@ -578,7 +578,7 @@ class ResponseTest extends ResponseTestCase
public function testIsEmpty()
{
foreach (array(201, 204, 304) as $code) {
foreach (array(204, 304) as $code) {
$response = new Response('', $code);
$this->assertTrue($response->isEmpty());
}