Skip to content

Commit

Permalink
Item14033: Retrofit some master validations to 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Jun 28, 2016
1 parent a244064 commit f475285
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/lib/Foswiki/UI/Rest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ sub rest {

$res->header( -type => 'text/html', -status => '400' );
$err =
"ERROR: (400) Invalid REST invocation - $pathInfo is malformed\n";
"ERROR: (400) Invalid REST invocation - "
. Foswiki::urlEncode($pathInfo)
. " is malformed\n";
$res->print($err);
$session->logger->log( 'warning', "REST rejected: " . $err,
" - $referer", );
Expand All @@ -150,10 +152,11 @@ sub rest {

# Check we have this handler
unless ($record) {

$res->header( -type => 'text/html', -status => '404' );
$err =
'ERROR: (404) Invalid REST invocation - '
. $pathInfo
. Foswiki::urlEncode($pathInfo)
. ' does not refer to a known handler';
_listHandlers($res) if $session->inContext('command_line');
$session->logger->log( 'warning', "REST rejected: " . $err,
Expand Down

0 comments on commit f475285

Please sign in to comment.