summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2020-08-03 22:05:25 +0200
committerUrban Müller2020-08-03 22:05:25 +0200
commit8e92b60178c34f785d6bcdd4634345e8937605b1 (patch)
treebbda3676928a6ad0c86b95d990626ae50e1ebe61
parent1e4439010c6cf239d5005b0341ca12c71733f1b0 (diff)
downloaditools-8e92b60178c34f785d6bcdd4634345e8937605b1.tar.gz
itools-8e92b60178c34f785d6bcdd4634345e8937605b1.tar.bz2
itools-8e92b60178c34f785d6bcdd4634345e8937605b1.zip
do not send empty headers
-rw-r--r--it_url.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/it_url.class b/it_url.class
index 712074d..318168c 100644
--- a/it_url.class
+++ b/it_url.class
@@ -172,13 +172,13 @@ static function _default_headers($url, $p)
if ((!it::is_devel() || EDC('subreqcheck')) && $p['url'] && !$p['headers']['Accept-Language'] && T_lang() != T_defaultlang() && $search_subrequest && !it::match('\blogin\.|banner\.html|machines\.txt|mbtiles\.php|/itjs/|/images/|\.(de|fr|en|it)(\.js|\.html|\.txt|\.php|\.ics|\.pdf|\.json|\.csv|\.gif|\.jpg|\.png)', $p['url']))
it::error(['title' => "Subrequest without language override", 'body' => [ $p ]]);
- $headers = [
+ $headers = array_filter(
'Host' => $url->realhostname . $url->explicitport,
'User-Agent' => "Mozilla/5.0 (compatible; ITools; Chrome/70.0.3538.102 Safari/537.36 Edge/18.19582)",
'Accept-Language' => $p['headers']['Accept-Language'] ?: ($search_subrequest ? T_defaultlang() : T_lang()), # can prevent loading of it_text
'Referer' => it::match('([-\w]+\.\w+)$', $url->hostname) == it::match('([-\w]+\.\w+)$', $_SERVER['HTTP_HOST']) ? it_url::absolute(U($_GET)) : null,
'X-Ultra-Https' => $_SERVER['HTTPS'],
- ];
+ );
if (is_int($p['filemtime']))
$headers['If-Modified-Since'] = date("r", $p['filemtime']);
return $headers;