mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-22 08:42:35 +02:00
[ticket/13414] Set Content-Length header only if status is not 304
PHPBB3-13414
This commit is contained in:
parent
ebd5aace3f
commit
a9fa20bb91
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user