diff options
author | Andreas Fischer <bantu@owncloud.com> | 2015-03-26 18:24:15 +0300 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2015-04-04 12:53:19 +0300 |
commit | 94ada409bbc9a0151a952b89bcfdebe32ba6c105 (patch) | |
tree | 55387ff7296b765b348d6297b4b5504daf293a68 /lib/public | |
parent | 8357a253b3f4a23d026a7fdb467a24154f7a70b0 (diff) |
Add OC_Response::setContentLengthHeader() for Apache PHP SAPI workaround.
Do not send Content-Length headers with a value larger than PHP_INT_MAX
(2147483647) on Apache PHP SAPI 32-bit. PHP will eat them and send 2147483647
instead.
When X-Sendfile is enabled, Apache will send a correct Content-Length header,
even for files larger than 2147483647 bytes. When X-Sendfile is not enabled,
ownCloud will not send a Content-Length header. This prevents progress bars
from working, but allows the actual transfer to work properly.
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/response.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/public/response.php b/lib/public/response.php index 24d3c81d628..c32eb4a05e0 100644 --- a/lib/public/response.php +++ b/lib/public/response.php @@ -64,6 +64,14 @@ class Response { } /** + * Sets the content length header (with possible workarounds) + * @param string|int|float $length Length to be sent + */ + static public function setContentLengthHeader($length) { + \OC_Response::setContentLengthHeader($length); + } + + /** * Disable browser caching * @see enableCaching with cache_time = 0 */ |