Skip to content

Question: rewind() after pulling ServerRequest body contents? #102

@BusterNeece

Description

@BusterNeece

I've noticed that in the decorated ServerRequest, when calling getParsedBody, the original body is pulled via (string)$request->getBody(), but the StreamInterface is not rewind-ed after the fact.

In my tests, this means that any call to $request->getBody()->getContents() that takes place after that call happens have the internal stream pointer moved to the end of the input stream, and thus pulls basically always nothing.

I'm not sure if this is just a natural and intended byproduct of how PSR-7's StreamInterface works, or if this is something that could be worked around at this level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions