Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 275fcd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/changelog/7.x.x.txt
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/WebGUI/Cache.pm
Expand Up @@ -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;
}
#-------------------------------------------------------------------
Expand Down

0 comments on commit 275fcd0

Please sign in to comment.