Skip to content

Commit 0f2e2c5

Browse files
committed
Disable the "Copy as cURL" button when the debug info are disabled
Some versions of curl have a bug that prevents collecting the debug info. This is reported by writing an explanation message in the debug buffer. When this is detecting, the "Copy as cURL" button is now skipped (like for other unsupported cases) instead of copying a broken command.
1 parent cd67fca commit 0f2e2c5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

DataCollector/HttpClientDataCollector.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ private function getCurlCommand(array $trace): ?string
230230
break;
231231
}
232232

233+
if (str_starts_with('Due to a bug in curl ', $line)) {
234+
// When the curl client disables debug info due to a curl bug, we cannot build the command.
235+
return null;
236+
}
237+
233238
if ('' === $line || preg_match('/^[*<]|(Host: )/', $line)) {
234239
continue;
235240
}

0 commit comments

Comments
 (0)