From a7adf808597c0ff5bf22ece6dda451d486a4ef34 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Fri, 26 Jun 2020 15:09:21 +0200 Subject: Refetch in get_cache() if headers are requested but cache does not contain them --- it_url.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'it_url.class') diff --git a/it_url.class b/it_url.class index 6608ee4..9b84996 100644 --- a/it_url.class +++ b/it_url.class @@ -519,7 +519,7 @@ static function get_cache($p = array()) if (!is_writable(dirname($path))) it::error("parent dir not writable: " . trim(it::exec('ls -ld {dir} 2>&1', ['dir' => dirname($path)]))); - if ($filemtime = it_url::_expired($path, $p['maxage'])) # Outdated(non-zero int) or non-existant(true)? + if (($filemtime = it_url::_expired($path, $p['maxage'])) || ($p['returnheaders'] && !file_exists(("$path.headers")))) # Outdated(non-zero int) or non-existant(true)? { $fileexists = $filemtime !== true; -- cgit v1.2.3