diff options
author | dakkar <dakkar@thenautilus.net> | 2014-12-28 18:10:29 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2014-12-28 18:10:29 +0000 |
commit | cc3bd295302eb0cf9de43d8be05b29ce83fa584f (patch) | |
tree | fefc86a514a58eee15ba3c53d6f581986abd8a8a | |
parent | cleanup for sharing (diff) | |
download | net-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.pm | 12 |
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', |