summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Quantum
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-08-09 04:46:07 +0200
committerDylan William Hardison <dylan@hardison.net>2018-08-20 23:52:52 +0200
commit74520b1b65b7dd7fded658033d19db55fa77f319 (patch)
tree4eec880896f26a2642714a6a2c68254ff78116a6 /Bugzilla/Quantum
parente90495d2aaee38547c06ccac1235ff1b6e4cdc82 (diff)
downloadbugzilla-74520b1b65b7dd7fded658033d19db55fa77f319.tar.gz
bugzilla-74520b1b65b7dd7fded658033d19db55fa77f319.tar.xz
more type checking
Diffstat (limited to 'Bugzilla/Quantum')
-rw-r--r--Bugzilla/Quantum/SES.pm13
1 files changed, 5 insertions, 8 deletions
diff --git a/Bugzilla/Quantum/SES.pm b/Bugzilla/Quantum/SES.pm
index e447b036a..03916075d 100644
--- a/Bugzilla/Quantum/SES.pm
+++ b/Bugzilla/Quantum/SES.pm
@@ -31,7 +31,7 @@ sub main {
}
catch {
FATAL("Error in SES Handler: ", $_);
- die $_;
+ $self->_respond( 400 => 'Bad Request' );
};
}
@@ -67,7 +67,8 @@ sub _main {
}
sub _confirm_subscription {
- my ($self, $message) = @_;
+ state $check = compile($Invocant, Dict[SubscribeURL => Str, slurpy Any]);
+ my ($self, $message) = $check->(@_);
my $subscribe_url = $message->{SubscribeURL};
if ( !$subscribe_url ) {
@@ -223,13 +224,9 @@ sub _respond {
}
sub _decode_json_wrapper {
- my ($self, $json) = @_;
+ state $check = compile($Invocant, Str);
+ my ($self, $json) = $check->(@_);
my $result;
- if ( !defined $json ) {
- WARN( 'Missing JSON from ' . $self->tx->remote_address );
- $self->_respond( 400 => 'Bad Request' );
- return undef;
- }
my $ok = try {
$result = decode_json($json);
}