Fixes #7881. Setting contentType to false will prevent the Content-Type header from being sent. Unit test added.

This commit is contained in:
jaubourg 2011-01-09 04:28:42 +01:00
parent 98c6c4b2b0
commit 69497c3fd7
3 changed files with 40 additions and 8 deletions

View file

@ -6,15 +6,11 @@ $headers = array();
foreach( $_SERVER as $key => $value ) {
if ( substr( $key , 0 , 5 ) == "HTTP_" ) {
$key = str_replace( "_" , "-" , substr( $key , 5) );
$headers[ $key ] = $value;
}
$key = str_replace( "_" , "-" , substr( $key , 0 , 5 ) == "HTTP_" ? substr( $key , 5 ) : $key );
$headers[ $key ] = $value;
}
foreach( explode( "_" , $_GET[ "keys" ] ) as $key ) {
echo "$key: " . $headers[ strtoupper( $key ) ] . "\n";
echo "$key: " . @$headers[ strtoupper( $key ) ] . "\n";
}