madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[ljcom] r11936: LJSUP-12148: JSON-RPC

Committer: sbelyaev
LJSUP-12148: JSON-RPC
U   trunk/cgi-bin/LJ/Response/JSON.pm
Modified: trunk/cgi-bin/LJ/Response/JSON.pm
===================================================================
--- trunk/cgi-bin/LJ/Response/JSON.pm	2012-05-14 08:40:26 UTC (rev 11935)
+++ trunk/cgi-bin/LJ/Response/JSON.pm	2012-05-14 10:40:47 UTC (rev 11936)
@@ -10,14 +10,16 @@
 sub output {
     my ($self) = @_;
 
-    my $output = LJ::JSON->to_json( $self->data );
-
     $self->output_http_headers;
 
-    LJ::Request->content_type('application/json; charset=utf-8');
     LJ::Request->send_cookies;
     LJ::Request->send_http_header();
-    LJ::Request->print($output);
+
+    if ($self->data) {
+        LJ::Request->content_type('application/json; charset=utf-8');
+        my $output = LJ::JSON->to_json( $self->data );
+        LJ::Request->print($output);
+    }
 }
 
 1;

Tags: ljcom, 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