summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_url.class')
-rw-r--r--it_url.class4
1 files changed, 4 insertions, 0 deletions
diff --git a/it_url.class b/it_url.class
index da1de16..cd23360 100644
--- a/it_url.class
+++ b/it_url.class
@@ -352,6 +352,10 @@ function request($p=array())
}
else
{
+ # Send a notice in cases where changing the default to empty_on_fail=true would change result for text results
+ if ($url->result >= 400 && $url->data && !isset($p['empty_on_fail']) && it::match('^text/', $url->headers['Content-Type']))
+ it::error(['to' => 'schneider@search.ch', 'title' => 'Failing it_url::get() without empty_on_fail but non-empty data', 'body' => ['p' => $p, 'url' => $url]]);
+
if ($url->result >= 400 && ($p['empty_on_fail'] || $p['keepfailed']))
$got = $url->data = false;
$result =& $url->data;