package Plack::Middleware::JSONP::Headers;
{
$Plack::Middleware::JSONP::Headers::VERSION = '0.11';
}
#ABSTRACT: Wraps JSON response with HTTP headers in JSONP
use strict;
use parent qw(Plack::Middl
eware);
use Plack::Util;
use Plack::Builder;
use URI::Escape ();
use JSON ();
use Scalar::Util 'reftype';
use HTTP::Headers ();
use Plack::Util::Accessor qw(callback_key headers template);
sub prepa
nless ($self->template) {
$self->template('{ "meta": %s, "data": %s }')
}
}
sub wrap_json {
my ($self, $status, $headers, $data) = @_;
my $meta = { status => $status };
my @