Skip to content

Commit

Permalink
Item14204: Port JsonRpcContrib tests to 2.1
Browse files Browse the repository at this point in the history
And fix a bug in redirectto handling - #anchors were being entity
encoded.
  • Loading branch information
gac410 committed Nov 1, 2016
1 parent 8f6b0e7 commit 62d92f1
Show file tree
Hide file tree
Showing 2 changed files with 572 additions and 9 deletions.
15 changes: 6 additions & 9 deletions JsonRpcContrib/lib/Foswiki/Contrib/JsonRpcContrib/Server.pm
Expand Up @@ -185,16 +185,13 @@ sub dispatch {

# finally
my $redirectto = $request->param('redirectto');
my $url;

if ( $code == 0 && defined $redirectto ) {
my $url;
if ( $redirectto =~ /^https?:/ ) {
$url = $redirectto;
}
else {
$url =
$session->getScriptUrl( 1, 'view', $session->{webName},
$redirectto );
}
$url = $session->redirectto($redirectto);
}

if ($url) {
$session->redirect($url);
}
else {
Expand Down

0 comments on commit 62d92f1

Please sign in to comment.