Closed

Description
This bug occurs when AppCache is used and the response is pulled from cache.
Serving response body with 304 status code is against HTTP spec.
This bug can be fixed here:
diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php
index 705e762..78960a2 100644
--- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php
+++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php
@@ -550,7 +550,7 @@ class HttpCache implements HttpKernelInterface
*/
private function restoreResponseBody(Request $request, Response $response)
{
- if ('head' === strtolower($request->getMethod())) {
+ if ('head' === strtolower($request->getMethod()) || 304 == $response->getStatusCode()) {
$response->setContent('');
$response->headers->remove('X-Body-Eval');
$response->headers->remove('X-Body-File');
but the solution will need some unit testing
Metadata
Metadata
Assignees
Labels
No labels