[HttpFoundation] Added the ability of mapping stream wrapper protocols when using X-Sendfile
This commit is contained in:
parent
dd129b71e3
commit
1da3d616a3
@ -192,6 +192,10 @@ class BinaryFileResponse extends Response
|
||||
// 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 (false === $path) {
|
||||
$path = $this->file->getPathname();
|
||||
}
|
||||
if (strtolower($type) == 'x-accel-redirect') {
|
||||
// Do X-Accel-Mapping substitutions.
|
||||
// @link http://wiki.nginx.org/X-accel#X-Accel-Redirect
|
||||
|
Reference in New Issue
Block a user