Merge branch '4.0' into 4.1

This commit is contained in:
Robbie Averill 2018-08-27 16:12:04 +12:00
commit 66c09afc9c

View File

@ -2,6 +2,8 @@
namespace SilverStripe\Control;
use SilverStripe\Core\Environment;
/**
* CLI specific request building logic
*/
@ -66,4 +68,19 @@ class CLIRequestBuilder extends HTTPRequestBuilder
// Parse rest of variables as standard
return parent::cleanEnvironment($variables);
}
/**
* @param array $variables
* @param string $input
* @return HTTPRequest
*/
public static function createFromVariables(array $variables, $input)
{
$request = parent::createFromVariables($variables, $input);
// unset scheme so that SS_BASE_URL can provide `is_https` information if required
$scheme = parse_url(Environment::getEnv('SS_BASE_URL'), PHP_URL_SCHEME);
$request->setScheme($scheme);
return $request;
}
}