mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
unset http scheme on CLIRequestBuilder
This commit is contained in:
parent
80bf0fc487
commit
64964f7402
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Control;
|
namespace SilverStripe\Control;
|
||||||
|
|
||||||
|
use SilverStripe\Core\Environment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CLI specific request building logic
|
* CLI specific request building logic
|
||||||
*/
|
*/
|
||||||
@ -66,4 +68,19 @@ class CLIRequestBuilder extends HTTPRequestBuilder
|
|||||||
// Parse rest of variables as standard
|
// Parse rest of variables as standard
|
||||||
return parent::cleanEnvironment($variables);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user