aboutsummaryrefslogtreecommitdiffstats
path: root/lib/files.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-05-17 14:14:12 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2013-05-17 14:14:12 -0400
commit9bebf9b4c81e12cd7ce47852538f6f8f10654e5b (patch)
treed3cda5df8f1645694ec04d6a3523103b57a38da0 /lib/files.php
parent0f314c14048b85a639ceb0c29e26f47e139e96c5 (diff)
downloadnextcloud-server-9bebf9b4c81e12cd7ce47852538f6f8f10654e5b.tar.gz
nextcloud-server-9bebf9b4c81e12cd7ce47852538f6f8f10654e5b.zip
Don't set Content-Length header if size is unknown
Diffstat (limited to 'lib/files.php')
-rw-r--r--lib/files.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/files.php b/lib/files.php
index ab7fa1ed096..abb1617c25e 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -123,8 +123,11 @@ class OC_Files {
header('Content-Length: ' . filesize($filename));
self::addSendfileHeader($filename);
}else{
+ $filesize = \OC\Files\Filesystem::filesize($filename);
header('Content-Type: '.\OC\Files\Filesystem::getMimeType($filename));
- header("Content-Length: ".\OC\Files\Filesystem::filesize($filename));
+ if ($filesize > -1) {
+ header("Content-Length: ".$filesize);
+ }
list($storage) = \OC\Files\Filesystem::resolvePath($filename);
if ($storage instanceof \OC\Files\Storage\Local) {
self::addSendfileHeader(\OC\Files\Filesystem::getLocalFile($filename));