summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Gass2018-04-23 15:39:29 +0200
committerNathan Gass2018-04-23 15:39:29 +0200
commit6ed5d50f5bd4ccc4d78dfdc47f3b95d4bdc20af3 (patch)
treea69f1cb78cd473f309429e547ff073649a93a103
parent89d02c90e8fe422cad65b7ff03960f58e5b4a8f1 (diff)
downloaditools-6ed5d50f5bd4ccc4d78dfdc47f3b95d4bdc20af3.tar.gz
itools-6ed5d50f5bd4ccc4d78dfdc47f3b95d4bdc20af3.tar.bz2
itools-6ed5d50f5bd4ccc4d78dfdc47f3b95d4bdc20af3.zip
make testserver independent of our normal php environment to avoid redirects
-rw-r--r--tests/it_url.testserver.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/it_url.testserver.php b/tests/it_url.testserver.php
index d394b58..9f04b48 100644
--- a/tests/it_url.testserver.php
+++ b/tests/it_url.testserver.php
@@ -1,7 +1,7 @@
<?php
-require '/www/server/phpinclude/auto_prepend.php';
$stderr = fopen('php://stderr', 'w');
fwrite($stderr, "Got Request: '" . $_SERVER['REQUEST_URI'] . "'\n");
+$base = 'http://' . $_SERVER['HTTP_HOST'];
switch ($_SERVER['PHP_SELF'])
{
@@ -10,21 +10,21 @@ switch ($_SERVER['PHP_SELF'])
break;
case "/temp_redirect":
- it_url::redirect(U("redirect_target", array('type' => 'temporary')), 'temporary');
+ header("Location: $base/redirect_target?type=temporary", true, 303);
break;
case "/perm_redirect":
- it_url::redirect(U("redirect_target", array('type' => 'permanent')), 'permanent');
+ header("Location: $base/redirect_target?type=permanent", true, 301);
break;
case "/created_redirect":
- header('Location: ' . it_url::absolute(U('redirect_target', array('type' => 'created'))), true, 201);
+ header("Location: $base/redirect_target?type=created", true, 201);
echo "Testserver output *before* created redirect";
- exit;
+ break;
case "/redirect_loop":
if ($_REQUEST['num'] > 0)
- it_url::redirect(U("redirect_loop", array('num' => $_REQUEST['num'] - 1)));
+ header("Location: $base/redirect_loop?num=" . ($_REQUEST['num'] - 1), true, 303);
break;
case "/nohost_redirect":