summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
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_sharing/lib
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_sharing/lib')
-rw-r--r--apps/files_sharing/lib/controllers/sharecontroller.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php
index 72294f6b26f..8662765d196 100644
--- a/apps/files_sharing/lib/controllers/sharecontroller.php
+++ b/apps/files_sharing/lib/controllers/sharecontroller.php
@@ -484,16 +484,25 @@ class ShareController extends Controller {
$this->emitAccessShareHook($share);
+ $server_params = array( 'head' => $this->request->getMethod() == 'HEAD' );
+
+ /**
+ * Http range requests support
+ */
+ if (isset($_SERVER['HTTP_RANGE'])) {
+ $server_params['range'] = $this->request->getHeader('Range');
+ }
+
// download selected files
if (!is_null($files) && $files !== '') {
// FIXME: The exit is required here because otherwise the AppFramework is trying to add headers as well
// after dispatching the request which results in a "Cannot modify header information" notice.
- OC_Files::get($originalSharePath, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD');
+ OC_Files::get($originalSharePath, $files_list, $server_params);
exit();
} else {
// FIXME: The exit is required here because otherwise the AppFramework is trying to add headers as well
// after dispatching the request which results in a "Cannot modify header information" notice.
- OC_Files::get(dirname($originalSharePath), basename($originalSharePath), $_SERVER['REQUEST_METHOD'] == 'HEAD');
+ OC_Files::get(dirname($originalSharePath), basename($originalSharePath), $server_params);
exit();
}
}