[dw-free] remove LJ::did_post from DW::Controller subclasses
[commit: http://hg.dwscoalition.org/dw-free/rev/e60d765b5519]
http://bugs.dwscoalition.org/show_bug.cgi?id=3969
Refactor common code into the base class.
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3969
Refactor common code into the base class.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/DW/Request/Apache2.pm
- cgi-bin/DW/Request/Base.pm
- cgi-bin/DW/Request/Standard.pm
-------------------------------------------------------------------------------- diff -r 1364c50df8e7 -r e60d765b5519 cgi-bin/DW/Request/Apache2.pm --- a/cgi-bin/DW/Request/Apache2.pm Fri Oct 28 19:26:06 2011 +0800 +++ b/cgi-bin/DW/Request/Apache2.pm Fri Oct 28 19:41:12 2011 +0800 @@ -66,13 +66,6 @@ return $self->{r}->method; } -# boolean: returns true if using POST method -sub did_post { - my DW::Request::Apache2 $self = $_[0]; - my $method = $self->method || ''; - return uc $method eq 'POST'; -} - # the URI requested (does not include host:port info) sub uri { my DW::Request::Apache2 $self = $_[0]; diff -r 1364c50df8e7 -r e60d765b5519 cgi-bin/DW/Request/Base.pm --- a/cgi-bin/DW/Request/Base.pm Fri Oct 28 19:26:06 2011 +0800 +++ b/cgi-bin/DW/Request/Base.pm Fri Oct 28 19:41:12 2011 +0800 @@ -84,6 +84,12 @@ return $self->add_cookie( %args ); } +sub did_post { + my DW::Request::Base $self = $_[0]; + my $method = $self->method || ''; + return uc $method eq 'POST'; +} + # FIXME: This relies on the behavior parse_args # and the \0 seperated arguments. This should be cleaned # up at the same point parse_args is. diff -r 1364c50df8e7 -r e60d765b5519 cgi-bin/DW/Request/Standard.pm --- a/cgi-bin/DW/Request/Standard.pm Fri Oct 28 19:26:06 2011 +0800 +++ b/cgi-bin/DW/Request/Standard.pm Fri Oct 28 19:41:12 2011 +0800 @@ -81,13 +81,6 @@ return $self->{req}->method; } -# boolean: returns true if using POST method -sub did_post { - my DW::Request::Standard $self = $_[0]; - my $method = $self->method || ''; - return uc $method eq 'POST'; -} - # the URI requested (does not include host:port info) sub uri { my DW::Request::Standard $self = $_[0]; --------------------------------------------------------------------------------