You are here

function _background_process_request_headers in Background Process 6

Same name and namespace in other branches
  1. 8 background_process.module \_background_process_request_headers()
  2. 7.2 background_process.http.inc \_background_process_request_headers()
  3. 7 background_process.module \_background_process_request_headers()

Get request headers

Return value

array headers

1 call to _background_process_request_headers()
background_process_build_request in ./background_process.module
Build url and headers for http request

File

./background_process.module, line 1405

Code

function _background_process_request_headers() {
  foreach ($_SERVER as $key => $value) {
    if (substr($key, 0, 5) == 'HTTP_') {
      $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($key, 5)))));
      if (empty($headers[$key])) {
        $headers[$key] = $value;
      }
      else {
        $headers[$key] .= "; {$value}";
      }
    }
  }
  return $headers;
}