Reading PUT request body.

Hello

I am working on REST API with oauth2 authorization.

For Oauth2 server i use https://github.com/bshaffer/oauth2-server-php

Php doc says here http://php.net/manual/en/wrappers.php.php

Prior to PHP 5.6, a stream opened with php://input could only be read once; the stream did not support seek operations. However, depending on the SAPI implementation, it may be possible to open another php://input stream and restart reading. This is only possible if the request body data has been saved. Typically, this is the case for POST requests, but not other request methods, such as PUT or PROPFIND.

In short it means that it is possible to read POST body twice, but not PUT.

But Oauth2 server reads it first time here https://github.com/bshaffer/oauth2-server-php/blob/develop/src/OAuth2/Request.php#L114

So when i read raw body in Yii2 Request, it is empty. (only on PUT, on POST and PATCH it is ok and can be read twice).

I know that this is kind of expected, no bugs. But what would be the solution for this?