Skip to content
Permalink
Browse files

Do not return content from cacheByHTTP if the request errors, otherwi…

…se callers can process bad content, like SC assets expecting RSS feeds and getting 404 error pages.
  • Loading branch information...
perlDreamer committed Mar 14, 2012
1 parent 4f85ad5 commit 275fcd0bb81d6b229dce84088627df9e567408a3
Showing with 5 additions and 4 deletions.
  1. +1 −0 docs/changelog/7.x.x.txt
  2. +4 −4 lib/WebGUI/Cache.pm
@@ -9,6 +9,7 @@
- RFE: 9730 (actually missing documentation)
- fixed: Crud updateFromFormPost
- fixed: encryptLogin and sslEnabled both need to be true
- fixed: Cache's setByHTTP method returns content, even when it gets an error in the request. This gives the SC asset fits.

7.10.24
- fixed #12318: asset error causes asset manager to fail
@@ -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;
}
#-------------------------------------------------------------------

0 comments on commit 275fcd0

Please sign in to comment.
You can’t perform that action at this time.