merged branch Inori/patch-3 (PR #8876)

This PR was merged into the master branch.

Discussion
----------

[HttpFoundation] add test to ensure Content-Length is preserved on HEAD

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Related to #8873

Commits
-------

42f0596 [HttpFoundation] add test to ensure that Content-Length is preserved on HEAD method
This commit is contained in:
Fabien Potencier 2013-08-28 22:01:19 +02:00
commit 5994f69a97

View File

@ -418,9 +418,12 @@ class ResponseTest extends ResponseTestCase
$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 testPrepareRemovesContentForInformationalResponse()