Remove useless hook

This commit is contained in:
Xavier Guimard 2015-12-26 20:08:25 +00:00
parent 0d42b85e7d
commit e477e4d6e2

View File

@ -99,18 +99,7 @@ sub sendJSONresponse {
$args{code} ||= 200;
my $type = 'text/json';
if ( ref $j ) {
if ( $args{forceJSON} or $req->accept =~ m|application/json| ) {
$j = $_json->encode($j);
}
else {
# TODO: escape keys in hash values
eval {
require XML::Simple;
$j = XML::Simple::XMLout($j);
$type = 'text/xml';
};
}
$j = $_json->encode($j);
}
return [ $args{code}, [ 'Content-Type', $type ], [$j] ];
}