bug #20218 [HttpFoundation] no 304 response if method is not cacheable (xabbuh)

This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation] no 304 response if method is not cacheable

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Since #19321 OPTIONS and TRACE are considered safe methods. But both methods should not lead to "304 Not modified" responses.

Commits
-------

3d6b450 no 304 response if method is not cacheable
This commit is contained in:
Fabien Potencier 2016-10-14 07:10:20 -07:00
commit 8d218e7f50
1 changed files with 1 additions and 1 deletions

View File

@ -1000,7 +1000,7 @@ class Response
*/
public function isNotModified(Request $request)
{
if (!$request->isMethodSafe()) {
if (!$request->isMethodCacheable()) {
return false;
}