Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Symfony/Component/HttpFoundation/StreamedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public function prepare(Request $request)
{
if ('1.0' != $request->server->get('SERVER_PROTOCOL')) {
$this->setProtocolVersion('1.1');
$this->headers->set('Transfer-Encoding', 'chunked');
}

$this->headers->set('Cache-Control', 'no-cache');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testPrepareWith11Protocol()
$response->prepare($request);

$this->assertEquals('1.1', $response->getProtocolVersion());
$this->assertEquals('chunked', $response->headers->get('Transfer-Encoding'));
$this->assertNotEquals('chunked', $response->headers->get('Transfer-Encoding'), 'Apache assumes responses with a Transfer-Encoding header set to chunked to already be encoded.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a negative test to avoid regressions and document why it's necessary, i.e. assertNotEquals(...)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

$this->assertEquals('no-cache, private', $response->headers->get('Cache-Control'));
}

Expand Down