Neos\Flow\Tests\Unit\Http\ResponseTest::makeStandardsCompliantSetsBodyAndContentLengthForHeadRequests PHP Method

makeStandardsCompliantSetsBodyAndContentLengthForHeadRequests() public method

RFC 2616 / 4.4 (Message Length)
    public function makeStandardsCompliantSetsBodyAndContentLengthForHeadRequests()
    {
        $request = Request::create(new Uri('http://localhost'), 'HEAD');
        $content = '
			Pat grabbed her hat
			and her fat, wooden bat
			When her friends couldn\'t play,
			Pat yelled out, "Drat!"
			But then she hit balls
			to her dog and _-at.
		';
        $response = new Response();
        $response->setContent($content);
        $response->makeStandardsCompliant($request);
        $this->assertEquals('', $response->getContent());
        $this->assertEquals(strlen($content), $response->getHeader('Content-Length'));
        $response = new Response();
        $response->setHeader('Content-Length', 275);
        $response->makeStandardsCompliant($request);
        $this->assertEquals(275, $response->getHeader('Content-Length'));
    }
ResponseTest