无认证密码时,不校验是否存在授权头

pull/478/head
钢翼 2022-05-17 08:18:38 +08:00
parent bfb3b4ea13
commit debfb2222f
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
String deviceId = uri.getUser();
AuthorizationHeader authHead = (AuthorizationHeader) request.getHeader(AuthorizationHeader.NAME);
if (authHead == null) {
if (authHead == null && !StringUtils.isEmpty(sipConfig.getPassword())) {
logger.info("[注册请求] 未携带授权头 回复401: {}", requestAddress);
response = getMessageFactory().createResponse(Response.UNAUTHORIZED, request);
new DigestServerAuthenticationHelper().generateChallenge(getHeaderFactory(), response, sipConfig.getDomain());