jellyfin-web/dashboard-ui/bower_components/jquery/test/data/headers.php
2016-01-14 12:04:42 -05:00

24 lines
522 B
PHP

<?php
header( "Sample-Header: Hello World" );
header( "Empty-Header: " );
header( "Sample-Header2: Hello World 2" );
$headers = array();
foreach( $_SERVER as $key => $value ) {
$key = str_replace( "_" , "-" , substr( $key , 0 , 5 ) == "HTTP_" ? substr( $key , 5 ) : $key );
$headers[ $key ] = $value;
}
foreach( explode( "_" , $_GET[ "keys" ] ) as $key ) {
// Only echo if key exists in the header
if ( isset( $headers[ strtoupper( $key ) ] ) ) {
echo "$key: " . @$headers[ strtoupper( $key ) ] . "\n";
}
}