Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Closed
wants to merge 2 commits into from

Conversation

Sander-Toonen
Copy link
Contributor

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

@jakzal
Copy link
Contributor

jakzal commented Dec 31, 2014

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is wrong.

Copy link
Contributor Author

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 :)

Copy link
Member

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.

@Sander-Toonen Sander-Toonen changed the title [HttpFoundation] Added the ability of mapping stream wrapper protocols when using X-Sendfile [WIP] [HttpFoundation] Added the ability of mapping stream wrapper protocols when using X-Sendfile Dec 31, 2014
@stof
Copy link
Member

stof commented Dec 31, 2014

This needs to be covered by tests

@Sander-Toonen
Copy link
Contributor Author

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?

@jakzal
Copy link
Contributor

jakzal commented Dec 11, 2015

@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!

@jakzal jakzal closed this Dec 11, 2015
@Sander-Toonen
Copy link
Contributor Author

Awesome. Thanks!

nicolas-grekas added a commit that referenced this pull request Dec 18, 2015
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants