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.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/Master/tlpkg/tlperl/site/lib/LWP/Authen/Basic.pm b/Master/tlpkg/tlperl/site/lib/LWP/Authen/Basic.pm
index 513475f1a3c..0f007780f92 100644
--- a/Master/tlpkg/tlperl/site/lib/LWP/Authen/Basic.pm
+++ b/Master/tlpkg/tlperl/site/lib/LWP/Authen/Basic.pm
@@ -2,13 +2,21 @@ package LWP::Authen::Basic;
use strict;
-our $VERSION = '6.43';
+our $VERSION = '6.52';
+require Encode;
require MIME::Base64;
sub auth_header {
- my($class, $user, $pass) = @_;
- return "Basic " . MIME::Base64::encode("$user:$pass", "");
+ my($class, $user, $pass, $request, $ua, $h) = @_;
+
+ my $userpass = "$user:$pass";
+ # https://tools.ietf.org/html/rfc7617#section-2.1
+ my $charset = uc($h->{auth_param}->{charset} || "");
+ $userpass = Encode::encode($charset, $userpass)
+ if ($charset eq "UTF-8");
+
+ return "Basic " . MIME::Base64::encode($userpass, "");
}
sub _reauth_requested {