Skip to content

Commit 6efc00d

Browse files
committed
merged branch kriswallsmith/head-streamed-response-err (PR symfony#4502)
Commits ------- 280fc05 failing test for HEAD StreamedResponse requests Discussion ---------- [WIP] failing test for HEAD StreamedResponse requests An exception is thrown if you prepare a StreamedResponse with a HEAD request. I'm not sure what the right fix is… --------------------------------------------------------------------------- by kriswallsmith at 2012-06-06T15:51:04Z The Travis build is here: http://travis-ci.org/#!/symfony/symfony/builds/1543352 --------------------------------------------------------------------------- by sstok at 2012-06-08T11:07:31Z Well a HEAD can't/shouldn't be streamed as it doesn't contain a body so what is the real problem here? --------------------------------------------------------------------------- by kriswallsmith at 2012-06-08T16:14:18Z @sstok the response is prepared by the ResponseListener regardless of request method --------------------------------------------------------------------------- by adrienbrault at 2012-06-08T19:41:27Z Shouldn't the test at least assert something ?
2 parents 6baa2b1 + 280fc05 commit 6efc00d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ public function testPrepareWith10Protocol()
5050
$this->assertEquals('no-cache, private', $response->headers->get('Cache-Control'));
5151
}
5252

53+
public function testPrepareWithHeadRequest()
54+
{
55+
$response = new StreamedResponse(function () { echo 'foo'; });
56+
$request = Request::create('/', 'HEAD');
57+
58+
$response->prepare($request);
59+
}
60+
5361
public function testSendContent()
5462
{
5563
$called = 0;

0 commit comments

Comments
 (0)