diff --git a/src/Symfony/Component/HttpKernel/HttpCache/Store.php b/src/Symfony/Component/HttpKernel/HttpCache/Store.php index 7173f44ee3c76..8862fe28f3235 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/Store.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/Store.php @@ -410,6 +410,7 @@ private function persistRequest(Request $request) */ private function persistResponse(Response $response) { + $response->headers->remove('X-Debug-Token'); $headers = $response->headers->all(); $headers['X-Status'] = array($response->getStatusCode()); diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php index 12d301f387af5..20fbaa11fd4c9 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php @@ -90,6 +90,15 @@ public function testSetsTheXContentDigestResponseHeaderBeforeStoring() $this->assertEquals('ena94a8fe5ccb19ba61c4c0873d391e987982fbbd3', $res['x-content-digest'][0]); } + public function testStoresWithoutXDebugToken() + { + $request = Request::create('/foo'); + $this->store->write($request, new Response('foo', 200, array('X-Debug-Token' => uniqid()))); + + $response = $this->store->lookup($request); + $this->assertFalse($response->headers->has('X-Debug-Token')); + } + public function testFindsAStoredEntryWithLookup() { $this->storeSimpleEntry();