mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Fixed Director::forceSSL() breaking unit tests because headers were already sent
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@108435 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c140ce7395
commit
54f6acfc21
@ -646,7 +646,7 @@ class Director {
|
||||
if($matched && !isset($_SERVER['HTTPS'])) {
|
||||
$destURL = str_replace('http:', 'https:', Director::absoluteURL($_SERVER['REQUEST_URI']));
|
||||
|
||||
header("Location: $destURL");
|
||||
if(!headers_sent()) header("Location: $destURL");
|
||||
if(SapphireTest::is_running_test()) {
|
||||
return $destURL;
|
||||
} else {
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
* @todo test Director::alternateBaseFolder()
|
||||
*/
|
||||
class DirectorTest extends FunctionalTest {
|
||||
class DirectorTest extends SapphireTest {
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
|
Loading…
Reference in New Issue
Block a user