Skip to content

Commit

Permalink
Item13950: Don't abort rest for cache refresh requests
Browse files Browse the repository at this point in the history
Kinder & Gentler - just demote a global refresh=all to
refresh=cache for rest requests, since they don't handle errors as
easily.
  • Loading branch information
gac410 committed Feb 13, 2016
1 parent 2701dee commit 8a2b412
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions core/lib/Foswiki/PageCache.pm
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,22 @@ sub getPage {
$this->deleteAll();
}
else {
throw Foswiki::OopsException(
'accessdenied',
def => 'cache_refresh',
web => $web,
topic => $topic,
);
my $session = $Foswiki::Plugins::SESSION;
my $request = $session->{request};
my $action = substr( ( $request->{action} || 'view' ), 0, 4 );
if ( $action eq 'rest' ) {

# Demote 'all' to 'cache' rather than kill rest
$refresh = 'cache';
}
else {
throw Foswiki::OopsException(
'accessdenied',
def => 'cache_refresh',
web => $web,
topic => $topic,
);
}
}
}

Expand Down

0 comments on commit 8a2b412

Please sign in to comment.