Subject: | incorrect header being sent |
The header should be application/json, not text/x-json, according to
this document: http://www.ietf.org/rfc/rfc4627.txt.
Changing the _send_headers function as follows should fix the issue:
sub _send_headers {
my $self = shift;
my $private = $self->param('__CAP_JSON') || {};
if( defined $private->{header} ) {
$self->header_add( '-x-json' => $self->json_header_string );
}
if( defined $private->{json_body} ) {
$self->header_add('-type' => 'application/json');
} elsif ( defined $private->{json_callback} ) {
$self->header_add('-type' => 'text/javascript');
}
}
Thanks!