From 641d7d8e42ac45a339b885191822646cec842fc7 Mon Sep 17 00:00:00 2001 From: 64850858 <648540858@qq.com> Date: Mon, 7 Jun 2021 11:32:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E5=8F=82=E6=95=B0zl?= =?UTF-8?q?m=E8=AF=B7=E6=B1=82=E4=BB=A3=E7=90=86=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20=E6=B7=BB=E5=8A=A0=E5=AF=B9?= =?UTF-8?q?=E6=97=A0=E5=AF=86=E7=A0=81=E7=9B=B4=E6=8E=A5=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/genersoft/iot/vmp/conf/ProxyServletConfig.java | 7 +++---- .../transmit/request/impl/RegisterRequestProcessor.java | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) 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) {