Skip to content

Commit

Permalink
Request::authorize - use only realm and not realm+opaque when checkin…
Browse files Browse the repository at this point in the history
…g if

there is already an authorization header (i.e. failed auth)
  • Loading branch information
noxxi committed May 28, 2020
1 parent 79e7357 commit 908f5c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Net/SIP/Request.pm
Expand Up @@ -241,16 +241,16 @@ sub authorize {
foreach my $a (@auth) {
my $h = $a->{parameter};

# check if we already have an authorize header for this realm/opaque
# check if we already have an authorize header for this realm
if ( ! $existing_auth ) {
$existing_auth = {};
foreach my $hdr ( $self->get_header_hashval( $resp )) {
my @auth = grep { defined } map { $hdr->{parameter}{$_} }qw( realm opaque );
my @auth = grep { defined } map { $hdr->{parameter}{$_} }qw( realm );
$existing_auth->{ join( "\0",@auth ) } = 1;
}
}

my @auth = grep { defined } map { $h->{$_} }qw( realm opaque );
my @auth = grep { defined } map { $h->{$_} }qw( realm );
if ( $existing_auth->{ join( "\0",@auth ) } ) {
# we have this auth header already, don't repeat
next;
Expand Down

0 comments on commit 908f5c8

Please sign in to comment.