aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2014-12-28 18:10:29 +0000
committerdakkar <dakkar@thenautilus.net>2014-12-28 18:10:29 +0000
commitcc3bd295302eb0cf9de43d8be05b29ce83fa584f (patch)
treefefc86a514a58eee15ba3c53d6f581986abd8a8a
parentcleanup for sharing (diff)
downloadnet-hawk-cc3bd295302eb0cf9de43d8be05b29ce83fa584f.tar.gz
net-hawk-cc3bd295302eb0cf9de43d8be05b29ce83fa584f.tar.bz2
net-hawk-cc3bd295302eb0cf9de43d8be05b29ce83fa584f.zip
slightly less awkward try/CATCH
-rw-r--r--lib/Net/Hawk/Client.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Net/Hawk/Client.pm b/lib/Net/Hawk/Client.pm
index 2a9d4c9..ee80d57 100644
--- a/lib/Net/Hawk/Client.pm
+++ b/lib/Net/Hawk/Client.pm
@@ -97,13 +97,12 @@ package Net::Hawk::Client {
my $www_auth = get_header('www-authenticate',$headers);
if ($www_auth) {
- my $attributes;
- try {
+ my $attributes = try {
$attributes = parse_authorization_header(
$www_auth,<ts tsm error>,
);
- CATCH { default { return False } }
};
+ return False unless $attributes;
if ($attributes<ts>) {
my $tsm = calculate_ts_mac(
@@ -116,14 +115,13 @@ package Net::Hawk::Client {
my $serv_auth = get_header('server-authorization',$headers);
return True unless $serv_auth || $options<required>;
- my $attributes;
- try {
- $attributes = parse_authorization_header(
+ my $attributes = try {
+ parse_authorization_header(
$serv_auth,
<mac ext hash>,
);
- CATCH { default { return False } }
};
+ return False unless $attributes;
my $mac = calculate_mac(
'response',