-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WIP] [HttpFoundation] Added the ability of mapping stream wrapper protocols when using X-Sendfile #13187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Sander-Toonen
commented
Dec 31, 2014
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #12990 |
License | MIT |
Doc PR | ~ |
- Testcase for serving stream wrapped files using X-sendfile
…s when using X-Sendfile
Would be good to provide a test case. |
@@ -189,6 +189,10 @@ public function prepare(Request $request) | |||
// Use X-Sendfile, do not send any content. | |||
$type = $request->headers->get('X-Sendfile-Type'); | |||
$path = $this->file->getRealPath(); | |||
// Fall back to scheme://path for stream wrapped locations. | |||
if (empty($path)) { | |||
$path = $this->file->getPathname(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, am fixing it right now but since this is my first symfony pull request it takes me some time to figure out the procedures. Bare with me please :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz did a really nice job describing the workflow. Maybe this helps you. Especially the section Rework Your Patch might be of interest for you.
This needs to be covered by tests |
I'd really like to push this forward but I don't really know were to start in order to provide a test case. Could somebody please point me in some direction? |
@Sander-Toonen I have added the test case in #16971. It includes your commits (squashed) and it's sent against 2.3 branch. Thank you! |
Awesome. Thanks! |
…onse with stream wrappers (jakzal, Sander-Toonen) This PR was merged into the 2.3 branch. Discussion ---------- [HttpFoundation] Added the ability of using BinaryFileResponse with stream wrappers | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #12990 #13187 | License | MIT | Doc PR | ~ Commits ------- 1da3d61 [HttpFoundation] Added the ability of mapping stream wrapper protocols when using X-Sendfile dd129b7 [HttpFoundation] Add a test case for using BinaryFileResponse with stream wrappers