@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux phosweb008 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
Current Path :
/
homepage
/
v-mt
/
extlib
/
LWP
/
Authen
/
Path :
Upload File :
New :
File
Dir
/homepage/v-mt/extlib/LWP/Authen/Basic.pm
package LWP::Authen::Basic; use strict; require MIME::Base64; sub authenticate { my($class, $ua, $proxy, $auth_param, $response, $request, $arg, $size) = @_; my($user, $pass) = $ua->get_basic_credentials($auth_param->{realm}, $request->url, $proxy); return $response unless defined $user and defined $pass; my $auth_header = $proxy ? "Proxy-Authorization" : "Authorization"; my $auth_value = "Basic " . MIME::Base64::encode("$user:$pass", ""); # Need to check this isn't a repeated fail! my $r = $response; while ($r) { my $auth = $r->request->header($auth_header); if ($auth && $auth eq $auth_value) { # here we know this failed before $response->header("Client-Warning" => "Credentials for '$user' failed before"); return $response; } $r = $r->previous; } my $referral = $request->clone; $referral->header($auth_header => $auth_value); return $ua->request($referral, $arg, $size, $response); } 1;