-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Hey,
In ResponseSigner.php the Response body stream in being consumed by signResponse() at line 60. Although explicit casting using __toString() will always rewind a stream before reading it, calling the getContents() method from StreamInterface will not. As a result, the middleware is breaking expected behavior, since Response::getBody()->getContents() will always return empty string after a POST.
I fixed it with a simple $response->getBody()->rewind() just after assigning $parts. I guess you can also use tell() and the seek() but I failed to find any real-life scenarios where it would make sense for a middleware to start reading the stream halfway through.
Do you want a pull request for this or is the fix trivial enough like this?
Cheers,
Matt