diff options
author | dakkar <dakkar@thenautilus.net> | 2014-12-27 21:48:02 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2014-12-27 21:48:02 +0000 |
commit | 11105db8ba8015a970b5dc02f241ce8c37087351 (patch) | |
tree | 09147fe985f16606035683ee33befd25b336ce77 /lib | |
parent | fix exception stringification (diff) | |
download | net-hawk-11105db8ba8015a970b5dc02f241ce8c37087351.tar.gz net-hawk-11105db8ba8015a970b5dc02f241ce8c37087351.tar.bz2 net-hawk-11105db8ba8015a970b5dc02f241ce8c37087351.zip |
more tests & fixes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Net/Hawk/Utils.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Net/Hawk/Utils.pm b/lib/Net/Hawk/Utils.pm index e0473a2..a476ac9 100644 --- a/lib/Net/Hawk/Utils.pm +++ b/lib/Net/Hawk/Utils.pm @@ -48,17 +48,17 @@ package Net::Hawk::Utils { Net::Hawk::Errors::BadRequest.new( text => "Unknown attribute $key", value => $header, - ) unless $valid_keys{$key} :exists; + ).throw unless $valid_keys{~$key} :exists; Net::Hawk::Errors::BadRequest.new( text => "Bad attribute value $value", value => $header, - ) unless $value ~~ m{^<[ \w !#$%&'()*+,\-./:;\<=\>?@\[\]^`{|}~ ]>+$}; + ).throw unless $value ~~ m{^<[ \w !#$%&'()*+,\-./:;\<=\>?@\[\]^`{|}~ ]>+$}; Net::Hawk::Errors::BadRequest.new( text => "Duplicate attribute $key", value => $header, - ) if %attributes{$key} :exists; + ).throw if %attributes{$key} :exists; %attributes{$key} = ~$value; } |