diff options
-rw-r--r-- | app/config/config.yml | 3 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/HttpClientFactory.php | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/app/config/config.yml b/app/config/config.yml index 309945c5..bbcc682f 100644 --- a/app/config/config.yml +++ b/app/config/config.yml | |||
@@ -375,6 +375,9 @@ httplug: | |||
375 | clients: | 375 | clients: |
376 | wallabag_core: | 376 | wallabag_core: |
377 | factory: 'wallabag_core.http_client_factory' | 377 | factory: 'wallabag_core.http_client_factory' |
378 | config: | ||
379 | defaults: | ||
380 | timeout: 10 | ||
378 | plugins: ['httplug.plugin.logger'] | 381 | plugins: ['httplug.plugin.logger'] |
379 | wallabag_core.entry.download_images: | 382 | wallabag_core.entry.download_images: |
380 | factory: 'httplug.factory.auto' | 383 | factory: 'httplug.factory.auto' |
diff --git a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php index 4899d3d4..3e19a7be 100644 --- a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php +++ b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php | |||
@@ -60,13 +60,17 @@ class HttpClientFactory implements ClientFactory | |||
60 | $this->logger->log('debug', 'Restricted access config enabled?', ['enabled' => (int) $this->restrictedAccess]); | 60 | $this->logger->log('debug', 'Restricted access config enabled?', ['enabled' => (int) $this->restrictedAccess]); |
61 | 61 | ||
62 | if (0 === (int) $this->restrictedAccess) { | 62 | if (0 === (int) $this->restrictedAccess) { |
63 | return new GuzzleAdapter(new GuzzleClient()); | 63 | return new GuzzleAdapter(new GuzzleClient($config)); |
64 | } | 64 | } |
65 | 65 | ||
66 | // we clear the cookie to avoid websites who use cookies for analytics | 66 | // we clear the cookie to avoid websites who use cookies for analytics |
67 | $this->cookieJar->clear(); | 67 | $this->cookieJar->clear(); |
68 | // need to set the (shared) cookie jar | 68 | if (!isset($config['defaults']['cookies'])) { |
69 | $guzzle = new GuzzleClient(['defaults' => ['cookies' => $this->cookieJar]]); | 69 | // need to set the (shared) cookie jar |
70 | $config['defaults']['cookies'] = $this->cookieJar; | ||
71 | } | ||
72 | |||
73 | $guzzle = new GuzzleClient($config); | ||
70 | foreach ($this->subscribers as $subscriber) { | 74 | foreach ($this->subscribers as $subscriber) { |
71 | $guzzle->getEmitter()->attach($subscriber); | 75 | $guzzle->getEmitter()->attach($subscriber); |
72 | } | 76 | } |