function drupal_add_http_header

cis7 bootstrap.inc drupal_add_http_header($name, $value, $append = FALSE)
cle7 bootstrap.inc drupal_add_http_header($name, $value, $append = FALSE)
elmsmedia7 bootstrap.inc drupal_add_http_header($name, $value, $append = FALSE)
icor7 bootstrap.inc drupal_add_http_header($name, $value, $append = FALSE)
meedjum_blog7 bootstrap.inc drupal_add_http_header($name, $value, $append = FALSE)
mooc7 bootstrap.inc drupal_add_http_header($name, $value, $append = FALSE)

Sets an HTTP response header for the current page.

Note: When sending a Content-Type header, always include a 'charset' type, too. This is necessary to avoid security bugs (e.g. UTF-7 XSS).

Parameters

$name: The HTTP header name, or the special 'Status' header name.

$value: The HTTP header value; if equal to FALSE, the specified header is unset. If $name is 'Status', this is expected to be a status code followed by a reason phrase, e.g. "404 Not Found".

$append: Whether to append the value to an existing header or to replace it.

58 calls to drupal_add_http_header()
admin_menu_deliver in sites/all/modules/ulmus/admin_menu/admin_menu.module
Delivery callback for client-side HTTP caching.
admin_menu_js_cache in sites/all/modules/ulmus/admin_menu/admin_menu.module
Menu callback; Output administration menu for HTTP caching via AJAX request.
aggregator_test_feed in modules/aggregator/tests/aggregator_test.module
Page callback. Generates a test feed and simulates last-modified and etags.
ajax_deliver in includes/ajax.inc
Packages and sends the result of a page callback as an Ajax response.
authorize_access_denied_page in ./authorize.php
Renders a 403 access denied page for authorize.php.

... See full list

2 string references to 'drupal_add_http_header'
drupal_add_html_head_link in includes/common.inc
Adds a LINK tag with a distinct 'rel' attribute to the page's HEAD.
_drupal_default_html_head in includes/common.inc
Returns elements that are always displayed in the HEAD tag of the HTML page.

File

includes/bootstrap.inc, line 1129
Functions that need to be loaded on every Drupal request.

Code

function drupal_add_http_header($name, $value, $append = FALSE) {
  // The headers as name/value pairs.
  $headers = &drupal_static('drupal_http_headers', array());

  $name_lower = strtolower($name);
  _drupal_set_preferred_header_name($name);

  if ($value === FALSE) {
    $headers[$name_lower] = FALSE;
  }
  elseif (isset($headers[$name_lower]) && $append) {
    // Multiple headers with identical names may be combined using comma (RFC
    // 2616, section 4.2).
    $headers[$name_lower] .= ',' . $value;
  }
  else {
    $headers[$name_lower] = $value;
  }
  drupal_send_headers(array($name => $headers[$name_lower]), TRUE);
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.