Skip to content

Commit

Permalink
bug #20218 [HttpFoundation] no 304 response if method is not cacheabl…
Browse files Browse the repository at this point in the history
…e (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
  • Loading branch information
fabpot committed Oct 14, 2016
2 parents 7e2f24f + 3d6b450 commit 8d218e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/Response.php
Expand Up @@ -1000,7 +1000,7 @@ public function setVary($headers, $replace = true)
*/
public function isNotModified(Request $request)
{
if (!$request->isMethodSafe()) {
if (!$request->isMethodCacheable()) {
return false;
}

Expand Down

0 comments on commit 8d218e7

Please sign in to comment.