mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Don't check for secure requests on CLI. Fixes #1068
This commit is contained in:
parent
2ab5ba4a41
commit
d48bba189e
@ -670,8 +670,10 @@ if ( ! function_exists('force_https'))
|
||||
* Defaults to 1 year.
|
||||
* @param RequestInterface $request
|
||||
* @param ResponseInterface $response
|
||||
*
|
||||
*
|
||||
* Not testable, as it will exit!
|
||||
*
|
||||
* @throws \CodeIgniter\HTTP\RedirectException
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
function force_https(int $duration = 31536000, RequestInterface $request = null, ResponseInterface $response = null)
|
||||
@ -685,7 +687,7 @@ if ( ! function_exists('force_https'))
|
||||
$response = Services::response(null, true);
|
||||
}
|
||||
|
||||
if ($request->isSecure())
|
||||
if (is_cli() || $request->isSecure())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -842,7 +844,7 @@ if ( ! function_exists('is_really_writable'))
|
||||
* @param string $file
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
*
|
||||
* @codeCoverageIgnore Not practical to test, as travis runs on linux
|
||||
*/
|
||||
function is_really_writable($file)
|
||||
@ -938,7 +940,7 @@ if ( ! function_exists('function_usable'))
|
||||
* @param string $function_name Function to check for
|
||||
* @return bool TRUE if the function exists and is safe to call,
|
||||
* FALSE otherwise.
|
||||
*
|
||||
*
|
||||
* @codeCoverageIgnore This is too exotic
|
||||
*/
|
||||
function function_usable($function_name)
|
||||
@ -968,7 +970,7 @@ if (! function_exists('dd'))
|
||||
* Prints a Kint debug report and exits.
|
||||
*
|
||||
* @param array ...$vars
|
||||
*
|
||||
*
|
||||
* @codeCoverageIgnore Can't be tested ... exits
|
||||
*/
|
||||
function dd(...$vars)
|
||||
|
Loading…
x
Reference in New Issue
Block a user