Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b2645d

Browse files
[HttpClient] fix PHP warning + accept status code >= 600
1 parent9bcf9c1 commit0b2645d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

‎src/Symfony/Component/HttpClient/Response/CurlResponse.php‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,16 @@ private static function parseHeaderLine($ch, string $data, array &$info, array &
312312
}
313313

314314
if ("\r\n" !==$data) {
315-
// Regular header line: add it to the list
316-
self::addResponseHeaders([substr($data,0, -2)],$info,$headers);
315+
try {
316+
// Regular header line: add it to the list
317+
self::addResponseHeaders([substr($data,0, -2)],$info,$headers);
318+
}catch (TransportException$e) {
319+
$multi->handlesActivity[$id][] =null;
320+
$multi->handlesActivity[$id][] =$e;
321+
322+
return\strlen($data);
323+
}
324+
317325

318326
if (0 !==strpos($data,'HTTP/')) {
319327
if (0 ===stripos($data,'Location:')) {

‎src/Symfony/Component/HttpClient/Response/ResponseTrait.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ private static function initialize(self $response): void
253253
privatestaticfunctionaddResponseHeaders(array$responseHeaders,array &$info,array &$headers,string &$debug =''):void
254254
{
255255
foreach ($responseHeadersas$h) {
256-
if (11 <=\strlen($h) &&'/' ===$h[4] &&preg_match('#^HTTP/\d+(?:\.\d+)? ([12345]\d\d)(?: |$)#',$h,$m)) {
256+
if (11 <=\strlen($h) &&'/' ===$h[4] &&preg_match('#^HTTP/\d+(?:\.\d+)? ([123456789]\d\d)(?: |$)#',$h,$m)) {
257257
if ($headers) {
258258
$debug .="<\r\n";
259259
$headers = [];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp