Do not return content from cacheByHTTP if the request errors, otherwise callers can process bad content, like SC assets expecting RSS feeds and getting 404 error pages.

This commit is contained in:
Colin Kuskie 2012-03-13 21:29:32 -07:00
parent 4f85ad56e6
commit 275fcd0bb8
2 changed files with 5 additions and 4 deletions

View file

@ -242,11 +242,11 @@ sub setByHTTP {
my $response = $userAgent->request($request);
if ($response->is_error) {
$self->session->errorHandler->error($url." could not be retrieved.");
return undef;
}
else {
$self->set($response->decoded_content,$ttl);
}
return $response->decoded_content;
my $value = $response->decoded_content;
$self->set($value ,$ttl);
return $value;
}
#-------------------------------------------------------------------