Is there any reason not to normalize the hostname used for looking up
credentials, as passed to UserAgent->credentials?

It would also be terribly useful to allow undef as a wildcard.
Actually, I seem to remember reading some discussion about how to
generalize ->credentials.  What's the current thinking?

Andrew

--- ../LWP/UserAgent.pm 2003-12-31 10:58:09.000000000 -0800
+++ /home/andrew/UserAgent.pm   2004-03-31 09:38:49.000000000 -0800
@@ -542,7 +542,7 @@
 sub credentials
 {
     my($self, $netloc, $realm, $uid, $pass) = @_;
-    @{ $self->{'basic_authentication'}{$netloc}{$realm} } = ($uid, $pass);
+    @{ $self->{'basic_authentication'}{lc $netloc}{$realm} } = ($uid, $pass);
 }
 
 
@@ -551,7 +551,7 @@
     my($self, $realm, $uri, $proxy) = @_;
     return if $proxy;
 
-    my $host_port = $uri->host_port;
+    my $host_port = lc $uri->host_port;
     if (exists $self->{'basic_authentication'}{$host_port}{$realm}) {
        return @{ $self->{'basic_authentication'}{$host_port}{$realm} };
     }

Reply via email to