You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #46570 [HttpClient][WebProfilerBundle] Catch errors when encoding body for c… (Phillip Look)
This PR was merged into the 6.1 branch.
Discussion
----------
[HttpClient][WebProfilerBundle] Catch errors when encoding body for c…
| Q | A
| ------------- | ---
| Branch? | 6.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
In Symfony 6.1 a [button to copy a request as a cURL command](#43931) was introduced for the profiler.
But if I post a binary file containing null characters using the curl-http-client the `HttpClientDataCollector` throws an error.
```
Warning: Uncaught ValueError: escapeshellarg(): Argument #1 ($arg) must not contain any null bytes
```
My solution is to catch the `ValueError` in this situation and to return `null` as the resulting curl command. Returning `null` seems to be the standard handling for unexpectad values in this data collector.
Commits
-------
36e6fa0 [HttpClient][WebProfilerBundle] Catch errors when encoding body for curl command line
0 commit comments