public static function sOAuthUtil::get_headers in jQuery social stream 7
Same name and namespace in other branches
- 7.2 jquery_social_stream.js.inc \sOAuthUtil::get_headers()
1 call to sOAuthUtil::get_headers()
- sOAuthRequest::from_request in ./jquery_social_stream.js.inc
- attempt to build up a request from what was passed to the server
File
- ./jquery_social_stream.js.inc, line 1105
- JS callbacks.
Class
- sOAuthUtil
Code
public static function get_headers() {
if (function_exists('apache_request_headers')) {
$headers = apache_request_headers();
$out = array();
foreach ($headers as $key => $value) {
$key = str_replace(" ", "-", ucwords(strtolower(str_replace("-", " ", $key))));
$out[$key] = $value;
}
}
else {
$out = array();
if (isset($_SERVER['CONTENT_TYPE'])) {
$out['Content-Type'] = $_SERVER['CONTENT_TYPE'];
}
if (isset($_ENV['CONTENT_TYPE'])) {
$out['Content-Type'] = $_ENV['CONTENT_TYPE'];
}
foreach ($_SERVER as $key => $value) {
if (substr($key, 0, 5) == "HTTP_") {
$key = str_replace(" ", "-", ucwords(strtolower(str_replace("_", " ", substr($key, 5)))));
$out[$key] = $value;
}
}
}
return $out;
}