mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Fixed tests not working on the web side as redirection to https would occur
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@108666 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
11e9e2a348
commit
8b8df80ccb
@ -646,10 +646,11 @@ class Director {
|
|||||||
if($matched && !isset($_SERVER['HTTPS'])) {
|
if($matched && !isset($_SERVER['HTTPS'])) {
|
||||||
$destURL = str_replace('http:', 'https:', Director::absoluteURL($_SERVER['REQUEST_URI']));
|
$destURL = str_replace('http:', 'https:', Director::absoluteURL($_SERVER['REQUEST_URI']));
|
||||||
|
|
||||||
if(!headers_sent()) header("Location: $destURL");
|
// This coupling to SapphireTest is necessary to test the destination URL and to not interfere with tests
|
||||||
if(SapphireTest::is_running_test()) {
|
if(SapphireTest::is_running_test()) {
|
||||||
return $destURL;
|
return $destURL;
|
||||||
} else {
|
} else {
|
||||||
|
if(!headers_sent()) header("Location: $destURL");
|
||||||
die("<h1>Your browser is not accepting header redirects</h1><p>Please <a href=\"$destURL\">click here</a>");
|
die("<h1>Your browser is not accepting header redirects</h1><p>Please <a href=\"$destURL\">click here</a>");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user