diff --git a/src/main/java/com/genersoft/iot/vmp/conf/ProxyServletConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/ProxyServletConfig.java index 253904ce..06d62df4 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/ProxyServletConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/ProxyServletConfig.java @@ -51,12 +51,11 @@ public class ProxyServletConfig { @Override protected String rewriteQueryStringFromRequest(HttpServletRequest servletRequest, String queryString) { String queryStr = super.rewriteQueryStringFromRequest(servletRequest, queryString); - if (queryStr != null) { - queryStr += "&"; + if (!StringUtils.isEmpty(queryStr)) { + queryStr += "&secret=" + mediaConfig.getSecret(); }else { - queryStr = "?"; + queryStr = "secret=" + mediaConfig.getSecret(); } - queryStr += "secret=" + mediaConfig.getSecret(); return queryStr; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java index aa501d93..574f9c75 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java @@ -77,6 +77,9 @@ public class RegisterRequestProcessor extends SIPRequestAbstractProcessor { passwordCorrect = new DigestServerAuthenticationHelper().doAuthenticatePlainTextPassword(request, sipConfig.getSipPassword()); } + if (StringUtils.isEmpty(sipConfig.getSipPassword())){ + passwordCorrect = true; + } // 未携带授权头或者密码错误 回复401 if (authorhead == null || !passwordCorrect) {