Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3e131f5

Browse filesBrowse files
committed
[HttpKernel] fixed invalid test
According to ResponseHeaderBag::computeCacheControlValue(), a response with an ETag but no explicit Cache-Control header should have a sensible Cache-Control of "private, must-revalidate" set. According to Response::isCacheable(), a response that includes a private Cache-Controls is not considered cacheable. Therefore, in order for this test response to be cacheable and stored, it requires an explicit Cache-Control of public.
1 parent a0bae94 commit 3e131f5
Copy full SHA for 3e131f5

File tree

Expand file treeCollapse file tree

1 file changed

+1
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-0
lines changed

‎tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php

Copy file name to clipboardExpand all lines: tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ public function testValidatesPrivateResponsesCachedOnTheClient()
168168
$response->setContent('private data');
169169
}
170170
} else {
171+
$response->headers->set('Cache-Control', 'public');
171172
$response->setETag('"public tag"');
172173
if (in_array('"public tag"', $etags)) {
173174
$response->setStatusCode(304);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.