[HttpClient] fix support for NTLM auth

This commit is contained in:
Nicolas Grekas 2019-11-06 14:35:14 +01:00
parent 62bf1f5002
commit 370c4379a5

View File

@ -412,7 +412,9 @@ final class CurlResponse implements ResponseInterface
}
}
if ($statusCode < 300 || 400 <= $statusCode || null === $location || curl_getinfo($ch, CURLINFO_REDIRECT_COUNT) === $options['max_redirects']) {
if (401 === $statusCode && isset($options['auth_ntlm']) && 0 === strncasecmp($headers['www-authenticate'][0] ?? '', 'NTLM ', 5)) {
// Continue with NTLM auth
} elseif ($statusCode < 300 || 400 <= $statusCode || null === $location || curl_getinfo($ch, CURLINFO_REDIRECT_COUNT) === $options['max_redirects']) {
// Headers and redirects completed, time to get the response's content
$multi->handlesActivity[$id][] = new FirstChunk();