Skip to content

Conversation

@weierophinney
Copy link
Contributor

When middleware returns an HtmlResponse, the body stream is typically rewound, with the pointer at position 0. Unfortunately, this means that any write() operations will overwrite!

This patch does a check to see if the response is at eof(), and, if not and the response is seekable, sets the pointer to the end of the stream prior to writing.

When middleware returns an `HtmlResponse`, the body stream is typically
rewound, with the pointer at position 0. Unfortunately, this means that
any `write()` operations will *overwrite*!

This patch does a check to see if the response is at `eof()`, and, if
not and the response is seekable, sets the pointer to the end of the
stream prior to writing.
snapshotpl added a commit that referenced this pull request Jan 7, 2016
@snapshotpl snapshotpl merged commit 8fd4be3 into php-middleware:master Jan 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants