-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] http_method_override option is ignored when app is behind HttpCache #8481
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
Comments
Yes, see UPGRADE-2.2.md. |
Yes, I see the option was added in 2.3 - that is the version I am having this issue with. I have updated the summary. |
@mvrhov The issue with the config option is that it is used when booting the kernel, whcih means that HttpCache will not use the method override (as it boots the kernel only when it is a cache miss) |
@stof shouldn't unsafe request methods result in a cache miss? |
@stof nm, I think I see what the problem is. When checking to see if the method is safe, it is calling |
I just ran into this problem while using Sonata Admin Bundle, none of my delete actions were working because it needed $httpMethodParameterOverride to be true, but its false due to what @kbond mentioned above. For now I have reverted to calling Request::enableHttpMethodParameterOverride(); in my app.php as done earlier here: symfony/symfony-standard@1970b83 |
Closing as the configuration is only available when the Kernel is booted, which is not the case when a request is cached. |
I think this should be documented. When using the HttpCache, you need to call the method in your front controller instead of relying on the parameter |
Should I make a note anywhere else? |
This PR was merged into the master branch. Discussion ---------- [FrameworkBundle] Added comment about http_method_override and HttpCache | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #8481 | License | MIT | Doc PR | n/a Commits ------- 52d2bdd Added comment about http_method_override and HttpCache
…bond) This PR was merged into the master branch. Discussion ---------- Added comment about http_method_override and HttpCache related: symfony/symfony#8481 Commits ------- b6ee002 Added comment about http_method_override and HttpCache
correct this was not included here https://github.com/symfony/symfony-docs/pull/2355/files so i have opened this symfony/symfony-docs#3569 |
I added a note to the config: #9013 and a note in the front controller of symfony-standard: symfony/symfony-standard#592 but yeah, a note should be added to the docs too. |
The work around is to manually call
Request::enableHttpMethodParameterOverride();
in my front controller. Is this expected?2.3.*
without HttpCache:framework.http_method_override
is used and works as expected2.3.*
with HttpCache:framework.http_method_override
is ignoredThe text was updated successfully, but these errors were encountered: