Skip to content

Commit

Permalink
Merge pull request #30 from packagist/f/request-signature-generation
Browse files Browse the repository at this point in the history
Client: fix API client generation in case the body content is not rewinded
  • Loading branch information
naderman authored Mar 26, 2020
2 parents 8d45847 + 39c5b25 commit ca62ce3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ php:
- 7.1
- 7.2

before_install:
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;

install: composer install

cache:
Expand Down
2 changes: 1 addition & 1 deletion src/HttpClient/Plugin/RequestSignature.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function doHandleRequest(RequestInterface $request, callable $next, ca
'cnonce' => $this->getNonce(),
];

$content = $request->getBody()->getContents();
$content = (string) $request->getBody();
if ($content) {
$params['body'] = $content;
}
Expand Down

0 comments on commit ca62ce3

Please sign in to comment.