Skip to content

Commit

Permalink
[HttpFoundation] add test to ensure that Content-Length is preserved …
Browse files Browse the repository at this point in the history
…on HEAD method
  • Loading branch information
inoryy committed Aug 28, 2013
1 parent 32947b2 commit 42f0596
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php
Expand Up @@ -361,9 +361,12 @@ public function testPrepareRemovesContentForHeadRequests()
$response = new Response('foo');
$request = Request::create('/', 'HEAD');

$length = 12345;
$response->headers->set('Content-Length', $length);
$response->prepare($request);

$this->assertEquals('', $response->getContent());
$this->assertEquals($length, $response->headers->get('Content-Length'), 'Content-Length should be as if it was GET; see RFC2616 14.13');
}

public function testPrepareSetsPragmaOnHttp10Only()
Expand Down

0 comments on commit 42f0596

Please sign in to comment.