Browse Source

uac(k): use header types for detection

Daniel-Constantin Mierla 15 years ago
parent
commit
de3980f8ad
1 changed files with 3 additions and 3 deletions
  1. 3 3
      modules_k/uac/auth.c

+ 3 - 3
modules_k/uac/auth.c

@@ -231,9 +231,9 @@ struct hdr_field *get_autenticate_hdr(struct sip_msg *rpl, int rpl_code)
 	}
 	}
 	for( hdr=rpl->headers ; hdr ; hdr=hdr->next )
 	for( hdr=rpl->headers ; hdr ; hdr=hdr->next )
 	{
 	{
-		if ( hdr->type!=HDR_OTHER_T )
-			continue;
-		if (cmp_hdrname_str(&hdr->name, &hdr_name)==0)
+		if ( rpl_code==WWW_AUTH_CODE && hdr->type==HDR_WWW_AUTHENTICATE_T )
+			return hdr;
+		if ( rpl_code==PROXY_AUTH_CODE && hdr->type==HDR_PROXY_AUTHENTICATE_T )
 			return hdr;
 			return hdr;
 	}
 	}