]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'task/httprequest_optimiziations' of https://github.com/nupplaphil/frien...
authorPhilipp <admin@philipp.info>
Wed, 25 Aug 2021 16:01:34 +0000 (18:01 +0200)
committerPhilipp <admin@philipp.info>
Wed, 25 Aug 2021 16:01:34 +0000 (18:01 +0200)
src/Factory/HTTPClientFactory.php
src/Network/HTTPClient.php

index 7da2718d7f59821b725c82b1ec08d10221687732..7f7d5e5d7381e7ddaeee914048d815a00fa1717a 100644 (file)
@@ -101,6 +101,9 @@ class HTTPClientFactory extends BaseFactory
                $resolver->setRequestTimeout(10);
                // if the file is too large then exit
                $resolver->setMaxResponseDataSize(1000000);
+               // Designate a temporary file that will store cookies during the session.
+               // Some websites test the browser for cookie support, so this enhances results.
+               $resolver->setCookieJar(get_temppath() . '/url_resolver.cookie', true);
 
                return new HTTPClient($logger, $this->profiler, $guzzle, $resolver);
        }
index 72f11fa3edcbecdee78256ebe8faeb4526ea4651..f4293cd0866da9f935d4b6ebf7d46327d23d2a3c 100644 (file)
@@ -221,10 +221,6 @@ class HTTPClient implements IHTTPClient
 
                $url = trim($url, "'");
 
-               // Designate a temporary file that will store cookies during the session.
-               // Some websites test the browser for cookie support, so this enhances results.
-               $this->resolver->setCookieJar(tempnam(get_temppath() , 'url_resolver-'));
-
                $urlResult = $this->resolver->resolveURL($url);
 
                if ($urlResult->didErrorOccur()) {