Skip to content

HttpCache changes for 304 responses #1414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 23, 2011
Merged

HttpCache changes for 304 responses #1414

merged 4 commits into from
Jun 23, 2011

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Jun 23, 2011

Fixes #1413

@@ -550,7 +550,7 @@ class HttpCache implements HttpKernelInterface
*/
private function restoreResponseBody(Request $request, Response $response)
{
if ('head' === strtolower($request->getMethod())) {
if ('HEAD' === strtoupper($request->getMethod()) || 304 === $response->getStatusCode()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

strtoupper is unnecessary as $request->getMethod() already do it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right sorry, removed.

fabpot added a commit that referenced this pull request Jun 23, 2011
Commits
-------

7db0b95 [HttpKernel] Removed unnecessary strtoupper
0891c57 [HttpKernel] Added test
1350645 [HttpKernel] Uppercased a few http methods
05c9906 [HttpKernel] Suppress response content for 304 responses out of the cache

Discussion
----------

HttpCache changes for 304 responses

Fixes #1413
@fabpot fabpot merged commit 7db0b95 into symfony:master Jun 23, 2011
@ghost
Copy link

ghost commented Jun 23, 2011

Thanks!

@Seldaek
Copy link
Member Author

Seldaek commented Jun 23, 2011

No problem, thanks for reporting it and doing the work of figuring out the problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HttpCache] bug: response body is served with 304 status code
3 participants