return \
strlen($data); // Ignore HTTP trailers
} $statusCode =
curl_getinfo($ch, \CURLINFO_RESPONSE_CODE
);
if ($statusCode !==
$info['http_code'
] && !
preg_match("#^HTTP/\d+(?:\.\d+)? {
$statusCode}(?: |\r\n$)#",
$data)) { return \
strlen($data); // Ignore headers from responses to CONNECT requests
} if ("\r\n" !==
$data) { // Regular header line: add it to the list
self::
addResponseHeaders([substr($data, 0, -2
)],
$info,
$headers);
if (!
str_starts_with($data, 'HTTP/'
)) { if (0 ===
stripos($data, 'Location:'
)) { $location =
trim(substr($data, 9, -2
));
} return \
strlen($data);
} if (\
function_exists('openssl_x509_read'
) &&
$certinfo =
curl_getinfo($ch, \CURLINFO_CERTINFO
)) { $info['peer_certificate_chain'
] =
array_map('openssl_x509_read',
array_column($certinfo, 'Cert'
));
}