mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 08:17:47 +02:00
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
This commit is contained in:
@@ -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
|
// Close the db connection before sending the file
|
||||||
$db->sql_close();
|
$db->sql_close();
|
||||||
|
|
||||||
if (!set_modified_headers($attachment['filetime'], $user->browser))
|
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
|
// Try to deliver in chunks
|
||||||
@set_time_limit(0);
|
@set_time_limit(0);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user