Revert setCookieJar() and add overwrite parameter fpr rare cases

This commit is contained in:
Philipp Holzer 2021-08-25 18:01:07 +02:00
parent a6258cfbfa
commit 4ddaf49f53
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
2 changed files with 3 additions and 4 deletions

View 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);
}

View 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()) {