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
[HttpFoundation] fixed the check of 'proxy-revalidate' in Response::mustRevalidate() #15263
Conversation
The change looks good to me, but you should add a test for this to avoid future regressions. |
@axiac have you got time to add a test? Would be also nice if you rebased to the latest 2.3 branch as tests are currently failing on your PR. |
…ustRevalidate() 'proxy-revalidate' is not a header on its own but a 'Cache-Control' directive See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 This fixes issue #15262
Sorry to answer so late, I was away from computer during the last two weeks and a half. The directive In order to have something to test I think I should add a way to set the I am new to Symfony (I started working with it this year) and I am not sure what is the best way to do this. This is why I tried these alternative approaches:
Which approach do you think fits best with the current API (and design) of the |
@axiac For example, you could add the following two tests after public function testMustRevalidateWithMustRevalidateCacheControlHeader()
{
$response = new Response();
$response->headers->set('cache-control', 'must-revalidate');
$this->assertTrue($response->mustRevalidate());
}
public function testMustRevalidateWithProxyRevalidateCacheControlHeader()
{
$response = new Response();
$response->headers->set('cache-control', 'proxy-revalidate');
$this->assertTrue($response->mustRevalidate());
} |
@xabbuh The tests you suggested look like they belong there. Thank you for your support. |
👍 Status: reviewed |
👍 |
Good catch, thanks @axiac. |
…Response::mustRevalidate() (axiac) This PR was squashed before being merged into the 2.3 branch (closes #15263). Discussion ---------- [HttpFoundation] fixed the check of 'proxy-revalidate' in Response::mustRevalidate() | Q | A | ------------- | --- | Fixed tickets | #15262 | License | MIT 'proxy-revalidate' is not a header on its own but a 'Cache-Control' directive See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 Commits ------- 6c22f0a [HttpFoundation] fixed the check of 'proxy-revalidate' in Response::mustRevalidate()
'proxy-revalidate' is not a header on its own but a 'Cache-Control' directive
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9