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 e7ec532 commit 780d3d1
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions core/lib/Foswiki/PageCache.pm
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

This comment has been minimized.

Copy link
@MichaelDaum

MichaelDaum Feb 15, 2016

Member

I can't see why that makes sense. True, rest handlers are bad in catching exceptions. But why demoting 'all' to 'cache'? This is a semantic shift in what's been intended that seems independent from any error handling.

$refresh = 'cache';
}
else {
throw Foswiki::OopsException(
'accessdenied',
def => 'cache_refresh',
web => $web,
topic => $topic,
);
}
}
}

Expand Down

0 comments on commit 780d3d1

Please sign in to comment.