madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22045: LJSUP-12148: JSON-RPC

Committer: sbelyaev
LJSUP-12148: JSON-RPC
U   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;

Tags: livejournal, madeon, pm, sbelyaev
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments