[Pkg-owncloud-commits] [owncloud] 02/69: Send URI instead of filepath to NGINX for X-Accel
David Prévot
taffit at moszumanska.debian.org
Sat May 10 16:20:31 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 9b4643f3865f5f14483b2e4618967f6cc91b0a22
Author: josh4trunks <joshruehlig at gmail.com>
Date: Thu Apr 3 20:46:54 2014 -0700
Send URI instead of filepath to NGINX for X-Accel
---
lib/private/files.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/private/files.php b/lib/private/files.php
index bfe6d3c..a377c19 100644
--- a/lib/private/files.php
+++ b/lib/private/files.php
@@ -152,7 +152,7 @@ class OC_Files {
/** @var $storage \OC\Files\Storage\Storage */
list($storage) = $view->resolvePath($filename);
if ($storage->isLocal()) {
- self::addSendfileHeader(\OC\Files\Filesystem::getLocalFile($filename));
+ self::addSendfileHeader($filename);
} else {
\OC\Files\Filesystem::readfile($filename);
}
@@ -167,9 +167,11 @@ class OC_Files {
*/
private static function addSendfileHeader($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);
@@ -185,6 +187,7 @@ class OC_Files {
}
if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) {
+ $filename = \OC::$WEBROOT . '/data' . \OC\Files\Filesystem::getRoot() . $filename;
header("X-Accel-Redirect: " . $filename);
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list