mashaurudin / oauth-php

Automatically exported from code.google.com/p/oauth-php
MIT License
0 stars 0 forks source link

oAuth reads php://input causing issues with reading PUT request body #123

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Use oAuth library in a server app

2. Make a PUT request to the server that contains a request body (for example a 
REST update request)

What is the expected output? What do you see instead?

oAuth works correctly, however the web app (server) now has no way to retrive 
the request body because php://input has already been read by oAuthRequest and 
oAuthRequestLogger.

Additionally OAuthRequestLogger probably doesn't log the request body correctly.

What version of the product are you using? On what operating system?

oAuth 175 on Linux/Apache

Please provide any additional information below.

http://php.net/manual/en/wrappers.php.php  (see note about reading the stream 
once)

A possible solution is to wrap php://input in such a way that the value is 
stored on read and only accessed through a public function that could be used 
internally by oAuth as well as by the server app itself.

Original issue reported on code.google.com by jasonmhi...@gmail.com on 19 Mar 2012 at 5:51