forked from wallabag/wallabag
Configure timeout
This commit is contained in:
@ -375,6 +375,9 @@ httplug:
|
|||||||
clients:
|
clients:
|
||||||
wallabag_core:
|
wallabag_core:
|
||||||
factory: 'wallabag_core.http_client_factory'
|
factory: 'wallabag_core.http_client_factory'
|
||||||
|
config:
|
||||||
|
defaults:
|
||||||
|
timeout: 10
|
||||||
plugins: ['httplug.plugin.logger']
|
plugins: ['httplug.plugin.logger']
|
||||||
wallabag_core.entry.download_images:
|
wallabag_core.entry.download_images:
|
||||||
factory: 'httplug.factory.auto'
|
factory: 'httplug.factory.auto'
|
||||||
|
|||||||
@ -60,13 +60,17 @@ class HttpClientFactory implements ClientFactory
|
|||||||
$this->logger->log('debug', 'Restricted access config enabled?', ['enabled' => (int) $this->restrictedAccess]);
|
$this->logger->log('debug', 'Restricted access config enabled?', ['enabled' => (int) $this->restrictedAccess]);
|
||||||
|
|
||||||
if (0 === (int) $this->restrictedAccess) {
|
if (0 === (int) $this->restrictedAccess) {
|
||||||
return new GuzzleAdapter(new GuzzleClient());
|
return new GuzzleAdapter(new GuzzleClient($config));
|
||||||
}
|
}
|
||||||
|
|
||||||
// we clear the cookie to avoid websites who use cookies for analytics
|
// we clear the cookie to avoid websites who use cookies for analytics
|
||||||
$this->cookieJar->clear();
|
$this->cookieJar->clear();
|
||||||
// need to set the (shared) cookie jar
|
if (!isset($config['defaults']['cookies'])) {
|
||||||
$guzzle = new GuzzleClient(['defaults' => ['cookies' => $this->cookieJar]]);
|
// need to set the (shared) cookie jar
|
||||||
|
$config['defaults']['cookies'] = $this->cookieJar;
|
||||||
|
}
|
||||||
|
|
||||||
|
$guzzle = new GuzzleClient($config);
|
||||||
foreach ($this->subscribers as $subscriber) {
|
foreach ($this->subscribers as $subscriber) {
|
||||||
$guzzle->getEmitter()->attach($subscriber);
|
$guzzle->getEmitter()->attach($subscriber);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user