Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Simplified headers tests: removed multiline headers (support is far t…
…oo servers & browsers dependant) and made all the tests in a single request.
- Loading branch information
Showing
3 changed files
with
24 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
<?php | ||
|
||
header( "Multiple-Line: Hello\n World" ); | ||
header( "Multiple-Multiple-Line: Hello\n Beautiful\n\t World" ); | ||
header( "Single-Line: Hello World" ); | ||
header( "Sample-Header: Hello World" ); | ||
|
||
$headers = array(); | ||
|
||
foreach( $_SERVER as $key => $value ) { | ||
|
||
if ( substr( $key , 0 , 5 ) == "HTTP_" ) { | ||
|
||
$key = str_replace( "_" , "-" , substr( $key , 5) ); | ||
$headers[ $key ] = $value; | ||
|
||
} | ||
|
||
} | ||
|
||
foreach( explode( "_" , $_GET[ "keys" ] ) as $key ) { | ||
echo "$key: " . $headers[ strtoupper( $key ) ] . "\n"; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters