Removed non-standard (and not that useful) xhr emulation methods & reworked the headers test as a consequence.
This commit is contained in:
parent
317888464d
commit
9b9d270e3d
3 changed files with 55 additions and 37 deletions
21
test/data/headers.request.php
Normal file
21
test/data/headers.request.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
if (!function_exists('apache_request_headers')) {
|
||||
function apache_request_headers() {
|
||||
foreach($_SERVER as $key=>$value) {
|
||||
if (substr($key,0,5)=="HTTP_") {
|
||||
$key=str_replace(" ","-",ucwords(strtolower(str_replace("_"," ",substr($key,5)))));
|
||||
$out[$key]=$value;
|
||||
}else{
|
||||
$out[$key]=$value;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
$headers = apache_request_headers();
|
||||
|
||||
foreach( explode( "_" , $_GET[ "keys" ] ) as $key ) {
|
||||
echo "$key: $headers[$key]\n";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue