merged branch fabpot/response-protocol (PR #5954)

This PR was merged into the 2.1 branch.

Commits
-------

e34fb41 [HttpFoundation] moved the HTTP protocol check from StreamedResponse to Response (closes #5937)

Discussion
----------

[HttpFoundation] moved the HTTP protocol check from StreamedResponse to Response (closes #5937)
This commit is contained in:
Fabien Potencier 2012-11-09 15:00:29 +01:00
commit ae61d354c9
2 changed files with 5 additions and 4 deletions

View File

@ -240,6 +240,11 @@ class Response
}
}
// Fix protocol
if ('HTTP/1.0' != $request->server->get('SERVER_PROTOCOL')) {
$this->setProtocolVersion('1.1');
}
return $this;
}

View File

@ -76,10 +76,6 @@ class StreamedResponse extends Response
*/
public function prepare(Request $request)
{
if ('HTTP/1.0' != $request->server->get('SERVER_PROTOCOL')) {
$this->setProtocolVersion('1.1');
}
$this->headers->set('Cache-Control', 'no-cache');
return parent::prepare($request);