Skip to content

Commit 275fcd0

Browse files
committedMar 14, 2012
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.
1 parent 4f85ad5 commit 275fcd0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
 

‎docs/changelog/7.x.x.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- RFE: 9730 (actually missing documentation)
1010
- fixed: Crud updateFromFormPost
1111
- fixed: encryptLogin and sslEnabled both need to be true
12+
- fixed: Cache's setByHTTP method returns content, even when it gets an error in the request. This gives the SC asset fits.
1213

1314
7.10.24
1415
- fixed #12318: asset error causes asset manager to fail

‎lib/WebGUI/Cache.pm

+4-4
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ sub setByHTTP {
242242
my $response = $userAgent->request($request);
243243
if ($response->is_error) {
244244
$self->session->errorHandler->error($url." could not be retrieved.");
245+
return undef;
245246
}
246-
else {
247-
$self->set($response->decoded_content,$ttl);
248-
}
249-
return $response->decoded_content;
247+
my $value = $response->decoded_content;
248+
$self->set($value ,$ttl);
249+
return $value;
250250
}
251251
252252
#-------------------------------------------------------------------

0 commit comments

Comments
 (0)