Fix redirect logging

This commit is contained in:
Philipp 2021-08-20 19:48:21 +02:00
parent 26401e88b8
commit 1995feff61
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD

View file

@ -197,12 +197,14 @@ class HTTPRequest implements IHTTPRequest
$curlOptions[CURLOPT_BINARYTRANSFER] = 1; $curlOptions[CURLOPT_BINARYTRANSFER] = 1;
} }
$logger = $this->logger;
$onRedirect = function( $onRedirect = function(
RequestInterface $request, RequestInterface $request,
ResponseInterface $response, ResponseInterface $response,
UriInterface $uri UriInterface $uri
) { ) use ($logger) {
$this->logger->notice('Curl redirect.', ['url' => $request->getUri(), 'to' => $uri]); $logger->notice('Curl redirect.', ['url' => $request->getUri(), 'to' => $uri]);
}; };
$onHeaders = function (ResponseInterface $response) use ($opts) { $onHeaders = function (ResponseInterface $response) use ($opts) {