From: Ian Jackson Date: Thu, 10 Jan 2013 19:23:56 +0000 (+0000) Subject: fix X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=b12ab8924ab6fcc141344514e1028350f302d70c;p=cgi-auth-flexible.git fix --- diff --git a/TODO b/TODO index d9fb334..b434df9 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,9 @@ REQUEST_METHOD=post CAHTEST_HOME=`pwd` ./test.cgi ; echo -sort out debugging +trying to log in always gives stale session + -form entry has wrong action url +sort out debugging update last in db when we return undef from check_divert diff --git a/cgi-auth-flexible.pm b/cgi-auth-flexible.pm index e5b8924..c3df875 100644 --- a/cgi-auth-flexible.pm +++ b/cgi-auth-flexible.pm @@ -884,12 +884,17 @@ sub _assert_checked ($) { die "unchecked" unless exists $r->{Divert}; } +sub _must_be_post ($) { + my ($r) = @_; + my $meth = $r->_ch('get_method'); + die "mutating non-POST" if $meth ne 'POST'; +} + sub check_mutate ($) { my ($r) = @_; $r->_assert_checked(); die if $r->{Divert}; - my $meth = $r->_ch('get_method'); - die "mutating non-POST" if $meth ne 'POST'; + $r->_must_be_post(); } #---------- output ----------