浏览代码

uac(k): use header types for detection

Daniel-Constantin Mierla 15 年之前
父节点
当前提交
de3980f8ad
共有 1 个文件被更改,包括 3 次插入3 次删除
  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 )
 	{
-		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;
 	}