Skip to content

Commit ffb1372

Browse files
committed
Fix the client when used with guzzle 7.9
Guzzle 7.9 introduces stricter checks on the protocol version. This protocol version is configured through the `version` config option. As the whole KeenIOClient config was passed to the instantiated Guzzle Client, this broke things because the version of the keen service was passed to Guzzle as the version config as well, while totally unrelated. The updated logic removes all config options corresponding to the KeenIOClient from the options passed to the Guzzle client.
1 parent 7a89c1b commit ffb1372

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: src/Client/KeenIOClient.php

+11
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ public static function factory($config = array())
7272

7373
$file = 'keen-io-' . str_replace('.', '_', $config['version']) . '.php';
7474

75+
$guzzleClientConfig = $config;
76+
unset(
77+
$guzzleClientConfig['masterKey'],
78+
$guzzleClientConfig['writeKey'],
79+
$guzzleClientConfig['readKey'],
80+
$guzzleClientConfig['projectId'],
81+
$guzzleClientConfig['organizationKey'],
82+
$guzzleClientConfig['organizationId'],
83+
$guzzleClientConfig['version']
84+
);
85+
7586
// Create the new Keen IO Client with our Configuration
7687
return new self(
7788
new Client($config),

0 commit comments

Comments
 (0)