summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-05-27 07:44:35 -0700
committerMichael Gapczynski <mtgap@owncloud.com>2013-05-27 07:44:35 -0700
commit6151c0d3109c24d2b5bdbf8dccb89107a974bf55 (patch)
tree714e4c010fffc24ed08eea6c484d616ed2138ffc
parent5e243b48bb51e94daa3ba32c9175945d579040c8 (diff)
parent9bebf9b4c81e12cd7ce47852538f6f8f10654e5b (diff)
downloadnextcloud-server-6151c0d3109c24d2b5bdbf8dccb89107a974bf55.tar.gz
nextcloud-server-6151c0d3109c24d2b5bdbf8dccb89107a974bf55.zip
Merge pull request #3412 from owncloud/fix_2013
Don't set Content-Length header if size is unknown
-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));