Skip to content
Snippets Groups Projects
Commit 31970ee7 authored by dratini0's avatar dratini0
Browse files

removed a little duplication

parent f2075f80
Branches
No related tags found
Loading
......@@ -161,12 +161,11 @@ class OC_Files {
* @param false|string $filename
*/
private static function addSendfileHeader($filename) {
$filename = \OC\Files\Filesystem::getLocalFile($filename);
if (isset($_SERVER['MOD_X_SENDFILE_ENABLED'])) {
$filename = \OC\Files\Filesystem::getLocalFile($filename);
header("X-Sendfile: " . $filename);
}
if (isset($_SERVER['MOD_X_SENDFILE2_ENABLED'])) {
$filename = \OC\Files\Filesystem::getLocalFile($filename);
if (isset($_SERVER['HTTP_RANGE']) &&
preg_match("/^bytes=([0-9]+)-([0-9]*)$/", $_SERVER['HTTP_RANGE'], $range)) {
$filelength = filesize($filename);
......@@ -182,7 +181,6 @@ class OC_Files {
}
if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) {
$filename = \OC\Files\Filesystem::getLocalFile($filename);
header("X-Accel-Redirect: " . $filename);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment