A security audit of a site complained about anti-caching headers. Some browsers and proxies 'ignore' the no-cache setting and do store some responses. These stored responses could then be read without permission.
The proposed solution was to add a 'no-store' to the caching. Easiest way was to change the default cache-control headers in drupal_page_header().

I'll add a patch that provides a variable with a default for the default page headers. Should give no backwards-compatible problems.

Comments

spadxiii’s picture

StatusFileSize
new715 bytes

The patch with the default page cache-control header in a variable.

mrharolda’s picture

Cool!

Another option could be to move the variable_get() into the drupal_send_headers() call to give you full control over all headers.

drupal_send_headers(variable_get('drupal_default_headers', $default_headers));
spadxiii’s picture

Status: Active » Needs review
StatusFileSize
new616 bytes

Updated the patch for latest 7.x

tessa bakker’s picture

StatusFileSize
new751 bytes

New patch based on latest dev

mvwensen’s picture

StatusFileSize
new697 bytes

Patch will not apply on the latest dev, created a new patch.

Status: Needs review » Needs work

The last submitted patch, 5: default_page_headers-2457613-5.patch, failed testing.

The last submitted patch, 5: default_page_headers-2457613-5.patch, failed testing.

tessa bakker’s picture

Tip: Use Metatag module to setup a global or context-specific Control-Cache tag.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.