Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[WebProfiler] add cURL copy/paste to request tab#62320
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
base:7.4
Are you sure you want to change the base?
[WebProfiler] add cURL copy/paste to request tab#62320
Conversation
carsonbot commentedNov 5, 2025
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
carsonbot commentedNov 5, 2025
Hey! Thanks for your PR. You are targeting branch "7.4" but it seems your PR description refers to branch "7.4 for features". Cheers! Carsonbot |
8409ee2 tocff32efCompareThere 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.
The curl command generation is flawed for several reasons:
- it does not escape arguments properly (making it unsuitable to be used as is)
- it uses
curl -Xeven whenit should not be used
Such logic should also be implemented in PHP in a method of the collector instead of attempting to write such complex logic in the Twig template (anyway, escaping shell arguments properly is not something we can do in Twig with only core functions and filters).
Note also that this won't make it to 7.4 (or 8.0) as we are way past the feature freeze date (which was end of September). This will be for 8.1.
You could see also HttpClientDataCollector which implements such "Copy as curl" as well. |
Thank you for these feedback. I'm unsure about where to implement the collector, so where would you put the PHP class in the WebProfiler bundle codebase? |
you don't need to implement a new collector. You need to add a new method in the RequestCollector (as you are adding that logic in the request panel, i.e. the panel associated to the RequestCollector) |
cff32ef to0dbe5dbCompareOkay, I have updated the RequestDataCollector class and I have something working in the template that is cleaner. 👍 |
a49f4fd tof835973Comparesrc/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
206ffa1 tof04f599Comparef04f599 toe4c4ff1Compare
Uh oh!
There was an error while loading.Please reload this page.
I often need to replay some requests on my application in dev mode, it's easier to generate it in the profiler Request view, copy it and paste in the terminal. It will generate the command with all given parameters/headers.
Here is a screenshot of this:

I don't know if it's mandatory to write tests for that, feel free to give some advice about that.