summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2020-06-26 15:09:21 +0200
committerChristian Schneider2020-06-26 15:09:21 +0200
commita7adf808597c0ff5bf22ece6dda451d486a4ef34 (patch)
treeaf61df12c2dce162c6efdd41ec56243c8276a19a
parent7c7cc5a83303dad6d5920cb87a00cac9a6ad626d (diff)
downloaditools-a7adf808597c0ff5bf22ece6dda451d486a4ef34.tar.gz
itools-a7adf808597c0ff5bf22ece6dda451d486a4ef34.tar.bz2
itools-a7adf808597c0ff5bf22ece6dda451d486a4ef34.zip
Refetch in get_cache() if headers are requested but cache does not contain them
-rw-r--r--it_url.class2
1 files changed, 1 insertions, 1 deletions
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;