summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-05-23 21:01:26 +0200
committerVincent Petry <pvince81@owncloud.com>2016-05-23 21:01:26 +0200
commitadcf942901fd567d97dbe105e8f3dfb7cea738e3 (patch)
tree3f3721d872941383689ba8ff661960d521af69c4 /apps/files
parent5a8af2f0be87cada2827ee3b86d2900146a62f77 (diff)
parent6577bbe887840889e16634b9bf1c4ce247ec265e (diff)
downloadnextcloud-server-adcf942901fd567d97dbe105e8f3dfb7cea738e3.tar.gz
nextcloud-server-adcf942901fd567d97dbe105e8f3dfb7cea738e3.zip
Merge pull request #24750 from owncloud/lenz1111-share_download_range_requests_support
Http Range requests support in downloads
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/ajax/download.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php
index 28ce4c6542e..aedd86b6419 100644
--- a/apps/files/ajax/download.php
+++ b/apps/files/ajax/download.php
@@ -50,4 +50,13 @@ if(isset($_GET['downloadStartSecret'])
setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/');
}
-OC_Files::get($dir, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD');
+$server_params = array( 'head' => \OC::$server->getRequest()->getMethod() == 'HEAD' );
+
+/**
+ * Http range requests support
+ */
+if (isset($_SERVER['HTTP_RANGE'])) {
+ $server_params['range'] = \OC::$server->getRequest()->getHeader('Range');
+}
+
+OC_Files::get($dir, $files_list, $server_params);