Created
April 13, 2015 04:36
-
-
Save joshkoenig/5bca8bfb8a4996941398 to your computer and use it in GitHub Desktop.
Background Process module tweakage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ADDED AN "X-.*" TO THE END TO AVOID RE-SENDING CUSTOM HEADERS. | |
/** | |
* Remove headers we do not wish to pass on to the next request. | |
* | |
* @param $headers | |
* Headers to filter | |
* @return array | |
* Filtered headers | |
*/ | |
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|X-.*)$/i', $key)) { | |
$result[$key] = $value; | |
} | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment