Skip Menu |

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 88565
Status: resolved
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc:
AdminCc:

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



Subject: Unreachable code in CPAN::HTTP::Client; bug?
sub _auth_headers { my ($self, $uri, $mode) = @_; # Get names for our mode-specific attributes my ($type_key, $param_key) = map {"_" . $mode . $_} qw/_type _params/; # If _prepare_auth has not been called, we can't prepare headers return unless $self->{$type_key}; # Get user credentials for mode my $cred_method = "get_" . ($mode ? "proxy" : "non_proxy") ."_credentials"; my ($user, $pass) = return CPAN::HTTP::Credentials->$cred_method; The previous line returns before assigning to $user and $pass, so the rest of the routine never runs. # Generate the header for the mode & type my $header = $mode eq 'proxy' ? 'Proxy-Authorization' : 'Authorization'; my $value_method = "_" . $self->{$type_key} . "_auth"; my $value = $self->$value_method($user, $pass, $self->{$param_key}, $uri); # If we didn't get a value, we didn't have the right modules available return $value ? ( $header, $value ) : (); }
Fixed in the repo. Thanks for finding that.
On Thu Sep 12 14:35:27 2013, DAGOLDEN wrote: Show quoted text
> Fixed in the repo. Thanks for finding that.
Or rather, fixed in *my* repo and pull request sent. Sometimes I forget that I can't push to the official repo. Which is probably a good thing, actually. :-)
On Thu Sep 12 14:35:27 2013, DAGOLDEN wrote: Show quoted text
> Fixed in the repo. Thanks for finding that.
Well, actually Matthew Horsfall found it, but you probably realise that by now.
Thank you sprout, dagolden, alh. Resolving at last