Skip to content

Commit 1da3d61

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

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/HttpFoundation/BinaryFileResponse.php

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