diff --git a/public/js/vroom.js b/public/js/vroom.js index e12ede5..3992595 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -35,7 +35,7 @@ $.ajax({ // Default ajax setup $.ajaxSetup({ - url: rootUrl + 'jsonrpc', + url: rootUrl + 'jsapi', type: 'POST', dataType: 'json', }); @@ -307,7 +307,7 @@ function initManage(){ function sendAction(data,sw){ $.ajax({ - url: rootUrl + 'admin/jsonrpc', + url: rootUrl + 'admin/jsapi', data: data, error: function(data) { $.notify(locale.ERROR_OCCURRED, 'error'); diff --git a/vroom.pl b/vroom.pl index 3e7618a..1d6594f 100755 --- a/vroom.pl +++ b/vroom.pl @@ -95,7 +95,7 @@ helper valid_room_name => sub { my ($name) = @_; my $ret = {}; # A few names are reserved - my @reserved = qw(about help feedback feedback_thanks goodbye admin create localize jsonrpc + my @reserved = qw(about help feedback feedback_thanks goodbye admin create localize jsapi missing dies password kicked invitation js css img fonts snd); if ($name !~ m/^[\w\-]{1,49}$/ || grep { $name eq $_ } @reserved){ return 0; @@ -1142,10 +1142,10 @@ get '/:room' => sub { }; # Route for various room actions -post '/*jsonrpc' => { jsonrpc => [qw(jsonrpc admin/jsonrpc)] } => sub { +post '/*jsapi' => { jsapi => [qw(jsapi admin/jsapi)] } => sub { my $self = shift; my $action = $self->param('action'); - my $prefix = ($self->stash('jsonrpc') eq 'admin/jsonrpc') ? 'admin' : 'room'; + my $prefix = ($self->stash('jsapi') eq 'admin/jsapi') ? 'admin' : 'room'; my $room = $self->param('room') || ''; # Lang switch can be done by unauth users if ($action eq 'langSwitch'){