Don't check for secure requests on CLI. Fixes #1068

This commit is contained in:
Lonnie Ezell 2018-06-21 23:38:49 -05:00
parent 2ab5ba4a41
commit d48bba189e
No known key found for this signature in database
GPG Key ID: 8EB408F8D82F5002

View File

@ -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)