Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
colintucker committed Jan 13, 2018
2 parents e49f706 + 2ec2d65 commit 16ef9eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _config/controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SilverStripe\CMS\Controllers\ContentController:
dev_server:
host: localhost
port: 8080
https: false
https: auto
timeout: 10
fallback: true
load_js: true
Expand Down
10 changes: 7 additions & 3 deletions src/Extensions/ControllerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,17 @@ public function getDevServerURL($path = null)

// Define Protocol:

$protocol = (isset($config['https']) && $config['https']) ? 'https' : 'http';
$protocol = function ($config) {
if (isset($config['https']) && $config['https'] !== 'auto') {
return sprintf('%s:', $config['https'] ? 'https' : 'http');
}
};

// Answer URL String:

return sprintf(
'%s://%s:%d/%s',
$protocol,
'%s//%s:%d/%s',
$protocol($config),
$config['host'],
$config['port'],
$path
Expand Down

0 comments on commit 16ef9eb

Please sign in to comment.