Skip to content

Commit 82554ad

Browse files
committedFeb 14, 2012
Make sure that HttpProxy cleans up after itself when purging assets or revisions.

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed
 

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
7.10.25
22
- fixed #12321: Error while deleting a group.
33
- fixed #12322: Cache/CHI stomps on the config file
4+
- fixed #12327: HttpProxy does not clean up cookie jar storage locations
45

56
7.10.24
67
- fixed #12318: asset error causes asset manager to fail

‎lib/WebGUI/Asset/Wobject/HttpProxy.pm

+24-2
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,36 @@ sub prepareView {
256256

257257
=head2 purge
258258
259-
Extend the base method to delete the cookie jar
259+
Extend the base method to delete all cookie jars for this HttpProxy
260260
261261
=cut
262262

263263
sub purge {
264+
my $self = shift;
265+
my $id = $self->getId;
266+
my $session = $self->session;
267+
my @storageIds = $session->db->buildArray("select cookieJarStorageId from HttpProxy where assetId=?",[$id]);
268+
my $success = $self->SUPER::purge;
269+
return 0 unless $success;
270+
foreach my $storageId (@storageIds) {
271+
my $storage = WebGUI::Storage->get($session, $storageId);
272+
$storage->delete if defined $storage;
273+
}
274+
return 1;
275+
}
276+
277+
#-------------------------------------------------------------------
278+
279+
=head2 purgeRevision
280+
281+
Extend the base method to delete the cookie jar for this revision.
282+
283+
=cut
284+
285+
sub purgeRevision {
264286
my $self = shift;
265287
$self->getCookieJar->delete;
266-
$self->SUPER::purge;
288+
$self->SUPER::purgeRevision;
267289
}
268290

269291

0 commit comments

Comments
 (0)
Please sign in to comment.