You are here

function authcache_get_content_type in Authenticated User Page Caching (Authcache) 7.2

Return current MIME content type.

Determines the MIME content type of the current page response based on the currently set Content-Type HTTP header.

This should normally return the string 'text/html' unless another module has overridden the content type.

Related topics

1 call to authcache_get_content_type()
authcache_authcache_cancel in ./authcache.module
Implements hook_authcache_cancel().

File

./authcache.module, line 823
Authenticated User Page Caching (and anonymous users, too!)

Code

function authcache_get_content_type($header = NULL) {
  if (!isset($header)) {
    $header = drupal_get_http_header('content-type');
  }
  $params = explode(';', $header);
  $params = array_map('trim', $params);
  $mime = array_shift($params);
  return array(
    'mimetype' => $mime,
    'params' => $params,
  );
}