Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1da3d61

Browse filesBrowse files
Sander-Toonenjakzal
authored andcommitted
[HttpFoundation] Added the ability of mapping stream wrapper protocols when using X-Sendfile
1 parent dd129b7 commit 1da3d61
Copy full SHA for 1da3d61

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed

‎src/Symfony/Component/HttpFoundation/BinaryFileResponse.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/BinaryFileResponse.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ public function prepare(Request $request)
192192
// Use X-Sendfile, do not send any content.
193193
$type = $request->headers->get('X-Sendfile-Type');
194194
$path = $this->file->getRealPath();
195+
// Fall back to scheme://path for stream wrapped locations.
196+
if (false === $path) {
197+
$path = $this->file->getPathname();
198+
}
195199
if (strtolower($type) == 'x-accel-redirect') {
196200
// Do X-Accel-Mapping substitutions.
197201
// @link http://wiki.nginx.org/X-accel#X-Accel-Redirect

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.