Skip to content

Commit

Permalink
Remove usage of 'Pragma: no-cache' header
Browse files Browse the repository at this point in the history
It is a deprecated HTTP/1.0 thing that should be replaced with a
Cache-Control header. Additionally we use it in an incorrect way, as the
directive is only defined in a request context (not response).

This was implemented as a workaround for an Internet Explorer bug, and
we don't support this browser anymore.

Fixes #33007
  • Loading branch information
dregad committed Dec 10, 2023
1 parent 7affe68 commit 0bfe58b
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions file_download.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,6 @@
# Make sure that IE can download the attachments under https.
header( 'Pragma: public' );

# To fix an IE bug which causes problems when downloading
# attached files via HTTPS, we disable the "Pragma: no-cache"
# command when IE is used over HTTPS.
global $g_allow_file_cache;
if( http_is_protocol_https() && is_browser_internet_explorer() ) {
# Suppress "Pragma: no-cache" header.
} else {
if( !isset( $g_allow_file_cache ) ) {
header( 'Pragma: no-cache' );
}
}
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s \G\M\T', time() ) );

header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s \G\M\T', $v_date_added ) );
Expand Down

0 comments on commit 0bfe58b

Please sign in to comment.