summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/bootstrap.inc16
-rw-r--r--includes/common.inc8
2 files changed, 15 insertions, 9 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 94cd83447..a486d0c03 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -768,25 +768,25 @@ function drupal_set_header($name = NULL, $value = NULL, $append = FALSE) {
// Save status codes using the special key ":status".
if (preg_match('/^\d{3} /', $name)) {
$value = $name;
- $name = ':status';
+ $name = $name_lower = ':status';
}
else {
- _drupal_set_preferred_header_name($name);
- $name = strtolower($name);
+ $name_lower = strtolower($name);
}
+ _drupal_set_preferred_header_name($name);
if (!isset($value)) {
- $headers[$name] = FALSE;
+ $headers[$name_lower] = FALSE;
}
- elseif (isset($headers[$name]) && $append) {
+ elseif (isset($headers[$name_lower]) && $append) {
// Multiple headers with identical names may be combined using comma (RFC
// 2616, section 4.2).
- $headers[$name] .= ',' . $value;
+ $headers[$name_lower] .= ',' . $value;
}
else {
- $headers[$name] = $value;
+ $headers[$name_lower] = $value;
}
- drupal_send_headers(array($name => $headers[$name]), TRUE);
+ drupal_send_headers(array($name => $headers[$name_lower]), TRUE);
}
/**
diff --git a/includes/common.inc b/includes/common.inc
index 55b7a278b..ec1673585 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -3027,8 +3027,14 @@ function page_set_cache() {
'data' => ob_get_clean(),
'expire' => CACHE_TEMPORARY,
'created' => REQUEST_TIME,
- 'headers' => drupal_get_header(),
+ 'headers' => array(),
);
+ // Restore preferred header names based on the lower-case names returned
+ // by drupal_get_header().
+ $header_names = _drupal_set_preferred_header_name();
+ foreach (drupal_get_header() as $name_lower => $value) {
+ $cache->headers[$header_names[$name_lower]] = $value;
+ }
if (variable_get('page_compression', TRUE) && function_exists('gzencode')) {
// We do not store the data in case the zlib mode is deflate. This should
// be rarely happening.