Session, fixed bug in algorithm detection, it was always choosing SHA-256
[catagits/Catalyst-Plugin-Session.git] / lib / Catalyst / Plugin / Session.pm
index 32dee9d..ae79a8e 100644 (file)
@@ -290,10 +290,12 @@ sub _find_digest () {
     unless ($usable) {
         foreach my $alg (qw/SHA-1 MD5 SHA-256/) {
             eval {
-                my $obj = Digest->new($alg);
-                $usable = $alg;
-                return $obj;
+                Digest->new($alg);
             };
+            unless ($@) {
+                $usable = $alg;
+                last;
+            }
         }
         $usable
           or Catalyst::Exception->throw(