diff options
author | Marc Alexander <admin@m-a-styles.de> | 2015-01-28 11:44:35 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2015-01-28 15:50:48 +0100 |
commit | a9fa20bb910bf89e5760c25ccacd16c42c6c139a (patch) | |
tree | b48ecf2b03e898959bd4eae90fac2bf41e03792a | |
parent | ebd5aace3fd556d6b588b07329a7eed37997045b (diff) | |
download | forums-a9fa20bb910bf89e5760c25ccacd16c42c6c139a.tar forums-a9fa20bb910bf89e5760c25ccacd16c42c6c139a.tar.gz forums-a9fa20bb910bf89e5760c25ccacd16c42c6c139a.tar.bz2 forums-a9fa20bb910bf89e5760c25ccacd16c42c6c139a.tar.xz forums-a9fa20bb910bf89e5760c25ccacd16c42c6c139a.zip |
[ticket/13414] Set Content-Length header only if status is not 304
PHPBB3-13414
-rw-r--r-- | phpBB/download/file.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php index ed33fc0962..cf8aaa03e8 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -509,16 +509,18 @@ function send_file_to_browser($attachment, $upload_dir, $category) } } - if ($size) - { - header("Content-Length: $size"); - } - // Close the db connection before sending the file $db->sql_close(); if (!set_modified_headers($attachment['filetime'], $user->browser)) { + // Send Content-Length only if set_modified_headers() does not send + // status 304 - Not Modified + if ($size) + { + header("Content-Length: $size"); + } + // Try to deliver in chunks @set_time_limit(0); |