function _background_process_filter_headers in Background Process 7
Same name and namespace in other branches
- 8 background_process.module \_background_process_filter_headers()
- 6 background_process.module \_background_process_filter_headers()
- 7.2 background_process.http.inc \_background_process_filter_headers()
Remove headers we do not wish to pass on to the next request.
Parameters
array $headers: Headers to filter
Return value
array Filtered headers
1 call to _background_process_filter_headers()
- background_process_build_request in ./
background_process.module - Build url and headers for http request.
File
- ./
background_process.module, line 1563
Code
function _background_process_filter_headers($headers) {
$result = array();
if (empty($headers)) {
return $result;
}
foreach ($headers as $key => $value) {
if (!preg_match('/^(Connection|Keep-Alive|Proxy-Authenticate|Proxy-Authorization|TE|Trailers|Transfer-Encoding|Upgrade|Set-Cookie|Content-Length|Host|Accept-Encoding)$/i', $key)) {
$result[$key] = $value;
}
}
return $result;
}