Committer: sbelyaev
LJSUP-12148: JSON-RPCU trunk/cgi-bin/LJ/JSON/RPC.pm
Modified: trunk/cgi-bin/LJ/JSON/RPC.pm =================================================================== --- trunk/cgi-bin/LJ/JSON/RPC.pm 2012-05-24 06:51:48 UTC (rev 22044) +++ trunk/cgi-bin/LJ/JSON/RPC.pm 2012-05-24 08:28:35 UTC (rev 22045) @@ -8,9 +8,11 @@ use LJ::Response::JSON; sub new { - my ($class, $uri, $request) = @_; + my ($class, $uri, $request, $callback) = @_; my $self = bless {}, $class; + $self->{'callback'} = $callback; + eval { my $data = LJ::JSON->from_json($request); @@ -82,9 +84,10 @@ $resp_data = $item->response($items->{'result'}); } - my $response = LJ::Response::JSON->new(); - $response->data($resp_data); - return $response; + return LJ::Response::JSON->new( + 'data' => $resp_data, + 'callback' => $self->{'callback'} ); + } 1;