Fixes #7881. Setting contentType to false will prevent the Content-Type header from...
[jquery.git] / test / data / headers.php
index c3cb729..d500b16 100644 (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";
 }