feat: prevent Maximum call stack size exceeded on client-managed requests#9852
Conversation
|
@samsonasik , could you please advise on the best way to fix this rector issue in ToolbarTest.php? |
michalsn
left a comment
There was a problem hiding this comment.
As for the Rector error, we probably will have to skip the RemoveExtraParametersRector rule for this test. But maybe there is a better way - I'm not an expert.
I agree. I’ve disabled |
michalsn
left a comment
There was a problem hiding this comment.
Thanks for the updates! I have a few final thoughts.
Co-authored-by: Michal Sniatala <michal@sniatala.pl>
Co-authored-by: Michal Sniatala <michal@sniatala.pl>
michalsn
left a comment
There was a problem hiding this comment.
Looks good. Please just list the methods with added return types in the changelog, under the "Method Signature Changes" section.
|
Thank you @datamweb |
Description
The Debug Toolbar injects HTML and JavaScript into every HTML response by default, which works for full page loads but causes issues for client-managed or partial requests (such as those from HTMX, Unpoly, or Hotwire Turbo) that expect clean HTML fragments. This can result in invalid HTML, duplicated scripts, or JavaScript errors like “Maximum call stack size exceeded.” To address this, support was added to skip Debug Toolbar HTML/JS injection for requests containing specific headers (e.g. HX-Request, X-Up-Version), while still preserving Debugbar response headers for network-level debugging.
I don’t consider this PR a new feature. I believe it could have been to the develop branch, but since it introduces the
$disableOnHeadersproperty, I only PR’d it to the 4.7 branch.Checklist: