summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/site/lib/LWP/Authen/Basic.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/site/lib/LWP/Authen/Basic.pm')
-rw-r--r--Master/tlpkg/tlperl/site/lib/LWP/Authen/Basic.pm18
1 files changed, 14 insertions, 4 deletions
diff --git a/Master/tlpkg/tlperl/site/lib/LWP/Authen/Basic.pm b/Master/tlpkg/tlperl/site/lib/LWP/Authen/Basic.pm
index d33e4af2e40..513475f1a3c 100644
--- a/Master/tlpkg/tlperl/site/lib/LWP/Authen/Basic.pm
+++ b/Master/tlpkg/tlperl/site/lib/LWP/Authen/Basic.pm
@@ -2,7 +2,7 @@ package LWP::Authen::Basic;
use strict;
-our $VERSION = '6.37';
+our $VERSION = '6.43';
require MIME::Base64;
@@ -11,6 +11,10 @@ sub auth_header {
return "Basic " . MIME::Base64::encode("$user:$pass", "");
}
+sub _reauth_requested {
+ return 0;
+}
+
sub authenticate
{
my($class, $ua, $proxy, $auth_param, $response,
@@ -37,9 +41,15 @@ sub authenticate
});
$h->{auth_param} = $auth_param;
- if (!$proxy && !$request->header($auth_header) && $ua->credentials($host_port, $realm)) {
- # we can make sure this handler applies and retry
- add_path($h, $url->path);
+ my $reauth_requested
+ = $class->_reauth_requested($auth_param, $ua, $request, $auth_header);
+ if ( !$proxy
+ && (!$request->header($auth_header) || $reauth_requested)
+ && $ua->credentials($host_port, $realm))
+ {
+ # we can make sure this handler applies and retry
+ add_path($h, $url->path)
+ unless $reauth_requested; # Do not clobber up path list for retries
return $ua->request($request->clone, $arg, $size, $response);
}