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:
parent
4f85ad56e6
commit
275fcd0bb8
2 changed files with 5 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue