If self{address} exists, use that instead of concatenating host + port

pull/4140/head^2
Isaac Connor 2025-01-05 13:11:19 -05:00
parent 0cfd860856
commit 833cc41b0b
1 changed files with 3 additions and 2 deletions

View File

@ -398,7 +398,7 @@ sub get_realm {
if ( $$self{realm} ne $tokens{realm} ) {
$$self{realm} = $tokens{realm};
Debug("Changing REALM to $$self{realm}, $$self{host}:$$self{port}, $$self{realm}, $$self{username}, $$self{password}");
$self->{ua}->credentials("$$self{host}:$$self{port}", $$self{realm}, $$self{username}, $$self{password});
$self->{ua}->credentials($$self{address}?$$self{address}:"$$self{host}:$$self{port}", $$self{realm}, $$self{username}, $$self{password});
$response = $self->get($url);
if ( !$response->is_success() ) {
Debug('Authentication still failed after updating REALM' . $response->status_line);
@ -417,9 +417,10 @@ sub get_realm {
} # end if
} # end foreach auth header
} else {
debug('No headers line');
Debug('No headers line');
} # end if headers
} # end if not authen
return undef;
} # end sub get_realm
1;