chiark / gitweb /
blinding: Fix move of Params setting into check_divert
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 27 Oct 2015 16:46:50 +0000 (16:46 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 27 Oct 2015 17:15:43 +0000 (17:15 +0000)
We were setting various things in $r rather than $r->{Divert}.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
cgi-auth-flexible.pm

index d3d9517..b4985ca 100644 (file)
@@ -1036,16 +1036,17 @@ sub check_divert ($) {
     $r->{Divert} = $r->_db_transaction(sub { $r->_check_divert_core(); });
     $dbh->commit();
 
-    my $cookraw = $r->{_CookieRaw};
-    $r->{CookieSecret} = $r->_blind($cookraw);
+    my $divert = $r->{Divert};
+    my $cookraw = $divert->{_CookieRaw};
+    $divert->{CookieSecret} = $r->_blind($cookraw);
     if ($cookraw) {
-       $r->{Params}{$r->{S}{assoc_param_name}} = [
+       $divert->{Params}{$r->{S}{assoc_param_name}} = [
            $r->_blind($r->hash($cookraw))
            ];
     }
 
-    $r->_debug(Data::Dumper->Dump([$r->{Divert}],[qw(divert)]));
-    return $r->{Divert};
+    $r->_debug(Data::Dumper->Dump([$divert],[qw(divert)]));
+    return $divert;
 }
 
 sub get_divert ($) {