-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation][HttpKernel] Reset request formats after each main request #59053
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ CHANGELOG | |
6.4 | ||
--- | ||
|
||
* Add call to `Request::resetFormats()` in `Kernel::boot()` to reset the request formats at the start of a new main request. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be removed as bug fixes are not listed in the CHANGELOGs. |
||
* Support backed enums in #[MapQueryParameter] | ||
* `BundleInterface` no longer extends `ContainerAwareInterface` | ||
* Add optional `$className` parameter to `ControllerEvent::getAttributes()` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,9 @@ public function boot() | |
{ | ||
if (true === $this->booted) { | ||
if (!$this->requestStackSize && $this->resetServices) { | ||
if (method_exists(Request::class, 'resetFormats')) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like that this leaks in the Kernel. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed having everything in the same component is better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's adding a new public method to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if that's necessary or if we couldn't handle it inside There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fabpot you know I'm not sure I love implementing /**
* Resets stateful request properties.
* @return void
* @internal
*/
public function reset(): void
{
Request::resetFormats();
} And yet, is this what you would expect "resetting" the request stack to do? It doesn't seem like it semantically makes sense in context of where it's placed. Likewise I wouldn't put it in Up to you (obviously) but the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have to keep the Otherwise, both approaches work for me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough in respect of |
||
Request::resetFormats(); | ||
} | ||
if ($this->container->has('services_resetter')) { | ||
$this->container->get('services_resetter')->reset(); | ||
} | ||
|
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.
This should be removed as bug fixes are not listed in the CHANGELOGs.