8000 add test case to confirm GET/OPTIONS cache issue · symfony/symfony@78c4a0c · GitHub
[go: up one dir, main page]

Skip to content

Commit 78c4a0c

Browse files
committed
add test case to confirm GET/OPTIONS cache issue
1 parent bcb1d8f commit 78c4a0c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,15 @@ public function testEsiCacheRemoveValidationHeadersIfEmbeddedResponses()
12641264
$this->assertNull($this->response->getETag());
12651265
$this->assertNull($this->response->getLastModified());
12661266
}
1267+
1268+
public function testDoesNotReturnCachedVersionFromDifferentRequestMethod()
1269+
{
1270+
$this->setNextResponse(200, array('Cache-Control' => 'public, s-maxage=60'));
1271+
$this->request('GET', '/');
1272+
$this->assertHttpKernelIsCalled();
1273+
$this->request('OPTIONS', '/');
1274+
$this->assertHttpKernelIsCalled(); //fails as it returns the cached response from above
1275+
}
12671276
}
12681277

12691278
class TestKernel implements HttpKernelInterface

0 commit comments

Comments
 (0)
0