Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

__toString() always return empty content when resource is not seekable #247

Conversation

svycka
Copy link
Contributor

@svycka svycka commented Apr 18, 2017

I have noticed this with amazon S3 it does return resource with meta seekable => false and I can't use this I have to create file and the n create new stream from it. Also does not make sense to rewind not seekable stream.

@svycka
Copy link
Contributor Author

svycka commented Apr 18, 2017

what's strange here that hhvm did not fail here: https://travis-ci.org/zendframework/zend-diactoros/builds/223063138
@weierophinney also not sure but maybe we should add this check also for phpStream and RelativeStream?

@weierophinney
Copy link
Member

@svycka The PhpInputStream is always seekable, and we have functionality to ensure rewinding works (by caching the data as we read). The RelativeStream implementation, since it delegates to another stream, likely needs the change as well; I'll try and write a test as I merge this to see what happens.

…t-for-not-seekable-resources

__toString() always return empty content when resource is not seekable
@weierophinney weierophinney added this to the 1.4.1 milestone Aug 16, 2017
@weierophinney weierophinney merged commit 39cc297 into zendframework:master Aug 16, 2017
weierophinney added a commit that referenced this pull request Aug 16, 2017
weierophinney added a commit that referenced this pull request Aug 16, 2017
weierophinney added a commit that referenced this pull request Aug 16, 2017
@weierophinney
Copy link
Member

Thanks, @svycka

@svycka svycka deleted the hotfix/return-content-for-not-seekable-resources branch August 17, 2017 05:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants