Commit e8ce12a
committed
bug symfony#52429 [HttpClient] Replace
This PR was merged into the 6.3 branch.
Discussion
----------
[HttpClient] Replace `escapeshellarg` to prevent overpassing `ARG_MAX`
| Q | A
| ------------- | ---
| Branch? | 6.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix symfony#49693
| License | MIT
I'm not 100% sure if it is a bugfix or a feature.
I used Nicolas' suggestion in the issue to sanitize the input and used `--data-raw` to avoid any automatic formatting.
Removing the use of `escapeshellarg()` also allows to remove `HttpClientDataCollectorTest::testItDoesNotGeneratesCurlCommandsForNotEncodableBody()`. Indeed, the body can now be encoded and will result on the following cURL command:
```
curl \\n
--compressed \\n
--request POST \\n
--url 'http://localhost:8057/json' \\n
--header 'Accept: */*' \\n
--header 'Content-Length: 1' \\n
--header 'Content-Type: application/x-www-form-urlencoded' \\n
--header 'Accept-Encoding: gzip' \\n
--header 'User-Agent: Symfony HttpClient (Native)' \\n
--data-raw '\x00'
```
Commits
-------
3b0bb11 [HttpClient] Replace `escapeshellarg` to prevent overpassing `ARG_MAX`escapeshellarg to prevent overpassing ARG_MAX (alexandre-daubois)File tree
2 files changed
+21
-50
lines changed- src/Symfony/Component/HttpClient
- DataCollector
- Tests/DataCollector
2 files changed
+21
-50
lines changedLines changed: 16 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 197 | + | |
200 | 198 | | |
201 | 199 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 200 | + | |
210 | 201 | | |
211 | 202 | | |
212 | 203 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 204 | + | |
217 | 205 | | |
218 | 206 | | |
219 | 207 | | |
| |||
255 | 243 | | |
256 | 244 | | |
257 | 245 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 246 | + | |
264 | 247 | | |
265 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
266 | 259 | | |
267 | 260 | | |
Lines changed: 5 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
| 340 | + | |
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
| 400 | + | |
423 | 401 | | |
424 | 402 | | |
425 | 403 | | |
| |||
435 | 413 | | |
436 | 414 | | |
437 | 415 | | |
438 | | - | |
| 416 | + | |
439 | 417 | | |
440 | 418 | | |
441 | 419 | | |
| |||
0 commit comments