diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/HttpClientFactory.php | 10 |
1 files changed, 7 insertions, 3 deletions
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 | } |