Util::Accessor qw(webhooks hipchat_user_agent );
use Plack::Util;
use Plack::Request;
use JSON qw(decode_json);
use Try::Tiny;
sub call {
my($self, $env) = @_;
my $Req = Plack::Request->new
application/json') {
# warn "Not application/json Content-Type\n";
return $self->return_400();
}
my $rh;
try {
$rh = decode_json($Req->conte
nt());
} catch {
# warn "Failed to decode JSON content\n";
};
if (!$rh) {
return $self->return_400();
}
my $rc = $rh_webhooks->{$path};