Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] Fix HttpCache validation HTTP method#19651
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
dunglas commentedAug 17, 2016
👍 |
| // send no head requests because we want content | ||
| $subRequest->setMethod('GET'); | ||
| if ($request->isMethodSafe() &&$request->getMethod() !=='HEAD') { | ||
| $subRequest->setMethod($request->getMethod()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Is this needed. By default, the subrequest is going to have the same method as the main one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Indeed, I updated this.
| // send no head requests because we want content | ||
| $subRequest->setMethod('GET'); | ||
| if (!$request->isMethodSafe() ||$request->getMethod() ==='HEAD') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm pretty sure thatisMethodSafe() here will always return true. If not, we would not lookup anything in the cache in the first place. So, this part of the condition can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Fixed
fabpot commentedAug 17, 2016
Thank you@tgalopin. |
This PR was merged into the 2.7 branch.Discussion----------[HttpKernel] Fix HttpCache validation HTTP method| Q | A| ------------- | ---| Branch? | 2.7| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#19582| License | MIT| Doc PR | -Commits-------1a8a8af [HttpKernel] Fix HttpCache validation HTTP method
Uh oh!
There was an error while loading.Please reload this page.