Skip to content

Commit

Permalink
Rewind request body
Browse files Browse the repository at this point in the history
  • Loading branch information
mrceperka authored and chadicus committed Nov 22, 2017
1 parent 2f86900 commit 9e26cfc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/RequestBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ class RequestBridge
*/
final public static function toOAuth2(ServerRequestInterface $request)
{
$contents = $request->getBody()->getContents();
$request->getBody()->rewind();

return new OAuth2\Request(
(array)$request->getQueryParams(),
(array)$request->getParsedBody(),
$request->getAttributes(),
$request->getCookieParams(),
self::convertUploadedFiles($request->getUploadedFiles()),
$request->getServerParams(),
(string)$request->getBody(),
$contents,
self::cleanupHeaders($request->getHeaders())
);
}
Expand Down

0 comments on commit 9e26cfc

Please sign in to comment.