diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-06-22 12:07:53 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-06-22 12:07:53 +0200 |
commit | c74c8eff3a36b0d8130c1ee5ad95adfa7c46e5b8 (patch) | |
tree | aff034f20dce1e56c34e179c0a57e5a8700995a5 /lib | |
parent | a9bca9e3aa58feb1d8c6a1f8fdd15e3a7c436650 (diff) | |
download | nextcloud-server-c74c8eff3a36b0d8130c1ee5ad95adfa7c46e5b8.tar.gz nextcloud-server-c74c8eff3a36b0d8130c1ee5ad95adfa7c46e5b8.zip |
Enable x-sendfile only if we do not lock the file system
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/private/files.php b/lib/private/files.php index 90d83a170bd..d08cb3f9de0 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -43,6 +43,7 @@ // TODO: get rid of this using proper composer packages require_once 'mcnetic/phpzipstreamer/ZipStreamer.php'; +use OC\Lock\NoopLockingProvider; use OCP\Lock\ILockingProvider; /** @@ -86,10 +87,13 @@ class OC_Files { public static function get($dir, $files, $only_header = false) { $view = \OC\Files\Filesystem::getView(); $xsendfile = false; - if (isset($_SERVER['MOD_X_SENDFILE_ENABLED']) || - isset($_SERVER['MOD_X_SENDFILE2_ENABLED']) || - isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) { - $xsendfile = true; + if (\OC::$server->getLockingProvider() instanceof NoopLockingProvider) { + if (isset($_SERVER['MOD_X_SENDFILE_ENABLED']) || + isset($_SERVER['MOD_X_SENDFILE2_ENABLED']) || + isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED']) + ) { + $xsendfile = true; + } } if (is_array($files) && count($files) === 1) { |