]> git.mxchange.org Git - friendica.git/commitdiff
Fix redirect logging
authorPhilipp <admin@philipp.info>
Fri, 20 Aug 2021 17:48:21 +0000 (19:48 +0200)
committerPhilipp <admin@philipp.info>
Fri, 20 Aug 2021 17:58:42 +0000 (19:58 +0200)
src/Network/HTTPRequest.php

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