This repository was archived by the owner on Jan 29, 2020. It is now read-only.
fixed SimpleStreamResponseSender ignored defined content length#315
Open
marc-mabe wants to merge 1 commit into
Open
fixed SimpleStreamResponseSender ignored defined content length#315marc-mabe wants to merge 1 commit into
marc-mabe wants to merge 1 commit into
Conversation
17 tasks
Member
|
This repository has been closed and moved to laminas/laminas-mvc; a new issue has been opened at laminas/laminas-mvc#2. |
Member
|
This repository has been moved to laminas/laminas-mvc. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Provide a narrative description of what you are trying to accomplish:
We are using the stream HTTP response to directly stream file content from S3 to clients.
As we are dealing with video files we are using the the
Range/Content-Rangeheaders to allow clients to download specific parts of files.To be able to do so we use the
Zend\Http\Response\Stream::setContentLengthmethod together withfseekto define the parts of the file to send.Where
Stream::readStreamis dealing with the content length it's not handled inSimpleStreamResponseSenderand the stream gets send until EOF.To fix that this PR uses
stream_copy_to_streamtophp://outputinstead offpassthruif a content length has been defined.Are you fixing a bug?
masterbranch, and submit against that branch.CHANGELOG.mdentry for the fix.Are you creating a new feature?
developbranch, and submit against that branch.CHANGELOG.mdentry for the new feature.Is this related to quality assurance?
Is this related to documentation?