Skip to content
Snippets Groups Projects
Commit 3f20a080 authored by mvn23's avatar mvn23
Browse files

Revert most changes for testing

parent a25bfa92
Branches
No related tags found
No related merge requests found
......@@ -173,18 +173,20 @@ class OC_Files {
header("X-Sendfile: " . $filename);
}
if (isset($_SERVER['MOD_X_SENDFILE2_ENABLED'])) {
if (isset($_SERVER['HTTP_RANGE']) &&
preg_match("/\Abytes=(?P<start>[0-9]+)-(?P<end>[0-9]*)\z/", $_SERVER['HTTP_RANGE'], $range)) {
if ($range['end'] == "") {
$range['end'] = filesize($filename) - 1;
}
header("Content-Range: bytes " . $range['start'] . "-" . $range['end'] . "/" . filesize($filename));
header("HTTP/1.1 206 Partial content");
header("X-Sendfile2: " . str_replace(",", "%2c", rawurlencode($filename)) . " " . $range['start'] . "-" . $range['end']);
} else {
header("X-Sendfile: " . $filename);
}
/* if (isset($_SERVER['HTTP_RANGE']) &&
* preg_match("/\Abytes=(?P<start>[0-9]+)-(?P<end>[0-9]*)\z/", $_SERVER['HTTP_RANGE'], $range)) {
* if ($range['end'] == "") {
* $range['end'] = filesize($filename) - 1;
* }
* header("Content-Range: bytes " . $range['start'] . "-" . $range['end'] . "/" . filesize($filename));
* header("HTTP/1.1 206 Partial content");
* header("X-Sendfile2: " . str_replace(",", "%2c", rawurlencode($filename)) . " " . $range['start'] . "-" . $range['end']);
* } else {
*/
header("X-Sendfile: " . $filename);
// }
}
if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) {
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