Changeset 1318 in tests for trunk/data/WPHTTP-testcase-redirection-script.php
- Timestamp:
- 07/28/2013 08:13:11 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/WPHTTP-testcase-redirection-script.php
r1231 r1318 24 24 exit; 25 25 } 26 26 27 if ( isset($_GET['201-location']) ) { 27 28 header("HTTP/1.1 201 OK"); … … 52 53 } 53 54 55 if ( isset( $_GET['post-redirect-to-method'] ) ) { 56 $method = $_SERVER['REQUEST_METHOD']; 57 $response_code = isset( $_GET['response_code'] ) ? $_GET['response_code'] : 301; 58 59 if ( 'POST' == $method && ! isset( $_GET['redirection-performed'] ) ) { 60 header( "Location: $url?post-redirect-to-method=1&redirection-performed=1", true, $response_code ); 61 exit; 62 } 63 64 echo $method; 65 exit; 66 67 } 68 69 if ( isset( $_GET['location-with-200'] ) ) { 70 if ( ! isset( $_GET['redirection-performed'] ) ) { 71 header( "HTTP/1.1 200 OK" ); 72 header( "Location: $url?location-with-200=1&redirection-performed", true, 200 ); 73 echo 'PASS'; 74 exit; 75 } 76 // Redirection was followed 77 echo 'FAIL'; 78 exit; 79 } 80 81 if ( isset( $_GET['print-pass'] ) ) { 82 echo 'PASS'; 83 exit; 84 } 85 54 86 $rt = isset($_GET['rt']) ? $_GET['rt'] : 5; 55 87 $r = isset($_GET['r']) ? $_GET['r'] : 0; 56 57 /*if ( $r === 0 ) {58 header("Location: http://tools.dd32.id.au/redirect/?r=1" );59 exit;60 }*/61 88 62 89 if ( $r < $rt ) { … … 70 97 echo "GET['r'] = Current redirection. Defaults to 0.<br />"; 71 98 echo "<a href='$url?source=true'>View Source</a>"; 99
Note: See TracChangeset
for help on using the changeset viewer.