diff options
author | Andreas Fischer <bantu@phpbb.com> | 2015-01-28 19:48:42 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2015-01-28 19:48:42 +0100 |
commit | 9d72463824d62e5506d8d9466e9713f70d413f18 (patch) | |
tree | b48ecf2b03e898959bd4eae90fac2bf41e03792a | |
parent | ebd5aace3fd556d6b588b07329a7eed37997045b (diff) | |
parent | a9fa20bb910bf89e5760c25ccacd16c42c6c139a (diff) | |
download | forums-9d72463824d62e5506d8d9466e9713f70d413f18.tar forums-9d72463824d62e5506d8d9466e9713f70d413f18.tar.gz forums-9d72463824d62e5506d8d9466e9713f70d413f18.tar.bz2 forums-9d72463824d62e5506d8d9466e9713f70d413f18.tar.xz forums-9d72463824d62e5506d8d9466e9713f70d413f18.zip |
Merge pull request #3343 from marc1706/ticket/13414
[ticket/13414] Set Content-Length header only if status is not 304
* marc1706/ticket/13414:
[ticket/13414] Set Content-Length header only if status is not 304
-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); |