Committer: sbelyaev
LJSUP-12579: Bug in IE8, FF3.6U trunk/cgi-bin/LJ/Response/JSON.pm
Modified: trunk/cgi-bin/LJ/Response/JSON.pm =================================================================== --- trunk/cgi-bin/LJ/Response/JSON.pm 2012-06-18 08:36:35 UTC (rev 12124) +++ trunk/cgi-bin/LJ/Response/JSON.pm 2012-06-18 10:53:18 UTC (rev 12125) @@ -21,11 +21,13 @@ if ($self->data) { LJ::Request->content_type($self->content_type); my $output = $self->do_gzip (LJ::JSON->to_json( $self->data )); - LJ::Request->header_out("Content-length", length $output); - LJ::Request->send_http_header(); + if ($self->callback) { $output = $self->callback . "($output)"; } + + LJ::Request->header_out("Content-length", length $output); + LJ::Request->send_http_header(); unless (LJ::Request->header_only) { LJ::Request->print($output); }