Nyholm / psr7

A super lightweight PSR-7 implementation
MIT License
1.16k stars 75 forks source link

fix psr17factory create stream #205

Closed nawedr closed 1 year ago

nawedr commented 1 year ago

Closes #204 As a fix, when we have created the stream, we can set the seek again to start of the file so that when we invoke $req->getBody()->getContents(); we get the actual body and not empty string.

nicolas-grekas commented 1 year ago

AFAIK, this behavior is not specified by PSR-7 so the current behavior is also correct. What could help is add a test case for this in https://github.com/php-http/psr7-integration-tests/ and ensuring all implementations agree on the expected behavior first.

Meanwhile, I'm closing here, please let us know.