mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Fixed tests not working on the web side as redirection to https would occur (from r108666)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112765 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
83e31e1f8a
commit
43f4500cd6
@ -646,10 +646,11 @@ class Director {
|
||||
if($matched && !isset($_SERVER['HTTPS'])) {
|
||||
$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()) {
|
||||
return $destURL;
|
||||
} 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>");
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user