diff --git a/system/Common.php b/system/Common.php index 61380b9ff7..6fceec13f4 100644 --- a/system/Common.php +++ b/system/Common.php @@ -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)