Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-Amazon-S3 CPAN distribution.

Report information
The Basics
Id: 35705
Status: resolved
Priority: 0/
Queue: Net-Amazon-S3

People
Owner: Nobody in particular
Requestors: joey [...] kitenet.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: bad tests for valid key, impossible to store or delete key "0"
unless $key && length $key This appears in 2 places in the code, and is wrong. $key could be "0". If so, "unless $key" will fail. Here's a patch: Index: lib/Net/Amazon/S3/Bucket.pm =================================================================== --- lib/Net/Amazon/S3/Bucket.pm (revision 19410) +++ lib/Net/Amazon/S3/Bucket.pm (working copy) @@ -112,7 +112,7 @@ # returns bool sub add_key { my ( $self, $key, $value, $conf ) = @_; - croak 'must specify key' unless $key && length $key; + croak 'must specify key' unless defined $key && length $key; if ( $conf->{acl_short} ) { $self->account->_validate_acl_short( $conf->{acl_short} ); @@ -260,7 +260,7 @@ # returns bool sub delete_key { my ( $self, $key ) = @_; - croak 'must specify key' unless $key && length $key; + croak 'must specify key' unless defined $key && length $key; return $self->account->_send_request_expect_nothing( 'DELETE', $self->_uri($key), {} ); }
Thanks for the patch. It will be in the next version of the module. Regards, Leon