From 42f0596f1a29954f4d4260a631b913a9aae7afba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Marint=C5=A1enko?= Date: Wed, 28 Aug 2013 22:35:29 +0300 Subject: [PATCH] [HttpFoundation] add test to ensure that Content-Length is preserved on HEAD method --- src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php index 3a084954c4..6efae35e9a 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php @@ -361,9 +361,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 testPrepareSetsPragmaOnHttp10Only()