Skip to content

Commit

Permalink
Revert dd1b19f and fix calls to GuzzleHttp\Psr7\Request
Browse files Browse the repository at this point in the history
This lets us stop locking to Guzzle 6.2 and properly fix the
random errors by only sending a Guzzle body if one was set in the
Eseye call.

Also, fixes #8
  • Loading branch information
leonjza committed Jul 10, 2017
1 parent dd1b19f commit 6f05b40
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"require": {
"php": ">= 7.0",
"guzzlehttp/guzzle": "6.2.*",
"guzzlehttp/guzzle": "^6.2",
"nesbot/carbon": "^1.21",
"monolog/monolog": "^1.22",
"predis/predis": "^1.1"
Expand Down
2 changes: 1 addition & 1 deletion src/Eseye.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Eseye
/**
* The Eseye Version.
*/
const VERSION = '0.0.8';
const VERSION = '0.0.9';

/**
* @var \Seat\Eseye\Containers\EsiAuthentication
Expand Down
9 changes: 8 additions & 1 deletion src/Fetchers/GuzzleFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,18 @@ public function httpRequest(
$this->logger->debug('Making ' . $method . ' request to ' . $uri);
$start = microtime(true);


// Json encode the body if it has data, else just null it
if (count($body) > 0)
$body = json_encode($body);
else
$body = null;

try {

// Make the _actual_ request to ESI
$response = $this->getClient()->send(
new Request($method, $uri, $headers, json_encode($body)));
new Request($method, $uri, $headers, $body));

} catch (ClientException $e) {

Expand Down

0 comments on commit 6f05b40

Please sign in to comment.