Skip to content

Commit

Permalink
If self{address} exists, use that instead of concatenating host + port
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Jan 5, 2025
1 parent 0cfd860 commit 833cc41
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/ZoneMinder/lib/ZoneMinder/Control.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 833cc41

Please sign in to comment.