From 8b8df80ccb0872599898f9bb2a471ce6f04fc437 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 29 Jul 2010 01:40:42 +0000 Subject: [PATCH] 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 --- core/control/Director.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/control/Director.php b/core/control/Director.php index 78337c724..6854d0eed 100755 --- a/core/control/Director.php +++ b/core/control/Director.php @@ -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("

Your browser is not accepting header redirects

Please click here"); } } else {