[dw-free] Add cookie support to DW::Request
[commit: http://hg.dwscoalition.org/dw-free/rev/2e0690ee55e1]
http://bugs.dwscoalition.org/show_bug.cgi?id=2446
Fix issue with requesting a cookie that doesn't exist.
Patch by
mark.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2446
Fix issue with requesting a cookie that doesn't exist.
Patch by
![[staff profile]](https://www.dreamwidth.org/img/silk/identity/user_staff.png)
Files modified:
- cgi-bin/DW/Request/Base.pm
-------------------------------------------------------------------------------- diff -r 48a202889c55 -r 2e0690ee55e1 cgi-bin/DW/Request/Base.pm --- a/cgi-bin/DW/Request/Base.pm Sun May 02 00:07:42 2010 +0000 +++ b/cgi-bin/DW/Request/Base.pm Sun May 02 00:10:33 2010 +0000 @@ -39,8 +39,8 @@ sub cookie { my DW::Request::Base $self = $_[0]; $self->parse( $self->header_in( 'Cookie' ) ) unless defined $self->{cookies_in}; - my $val = $self->{cookies_in}->{$_[1]}; - return wantarray ? @{ $val } : $val->[0]; + my $val = $self->{cookies_in}->{$_[1]} || []; + return wantarray ? @$val : $val->[0]; } sub cookie_multi { --------------------------------------------------------------------------------