Last active
April 20, 2020 21:18
-
-
Save CyberShadow/58df32ed1dbe64fffd0545f87d9321ad to your computer and use it in GitHub Desktop.
ae.sys.net test - https://github.com/cybershadow/ae/blob/master/sys/net/test.d
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
RewriteEngine On | |
RewriteRule test\.php - [L] | |
RewriteRule .* test.php?res=$0 [L] |
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
<?php | |
header('Content-Type: text/plain'); | |
switch ($_GET['res']) | |
{ | |
case 'testUrl1': | |
echo "Hello world\n"; | |
break; | |
case 'testUrl2': | |
# TODO | |
break; | |
case 'testUrl3': | |
header('Location: testUrl2'); | |
echo "Moved!\n"; | |
break; | |
case 'testUrl4': | |
readfile("php://input"); | |
break; | |
case 'testUrl5': | |
header('HTTP/1.1 202 Custom Message'); | |
header('Test-Response-Header: baz'); | |
echo $_SERVER['REQUEST_METHOD'].' '.$_SERVER['HTTP_TEST_REQUEST_HEADER'].' '; | |
readfile("php://input"); | |
break; | |
default: | |
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404); | |
echo "Not Found: ${_GET['res']}\n"; | |
break; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment