From 7446bf16470cdf3053554f82debf6d334d921f1a Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Fri, 29 Sep 2023 15:44:12 +0800 Subject: [PATCH] =?UTF-8?q?ua=20=E7=94=9F=E6=88=90=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/skcks/docking/gb28181/sip/utils/SipUtil.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/utils/SipUtil.java b/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/utils/SipUtil.java index 428283f..469c8a8 100644 --- a/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/utils/SipUtil.java +++ b/gb28181-sip/src/main/java/cn/skcks/docking/gb28181/sip/utils/SipUtil.java @@ -25,7 +25,7 @@ public class SipUtil { @Setter public static String UserAgent = "GB28181-Docking-Platform"; @Setter - public static String UserAgentVersion = "0.0.1"; + public static String UserAgentVersion = ""; private static final char[] DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz".toCharArray(); public static String nanoId(){ @@ -67,8 +67,10 @@ public class SipUtil { public static UserAgentHeader getUserAgentHeader(){ List agentParam = new ArrayList<>(3); agentParam.add(UserAgent); - agentParam.add(" "); - agentParam.add(StringUtils.replace(UserAgentVersion,"-SNAPSHOT","")); + if(StringUtils.isNotBlank(UserAgentVersion)){ + agentParam.add(" "); + agentParam.add(StringUtils.replace(UserAgentVersion,"-SNAPSHOT","")); + } return SipFactory.getInstance().createHeaderFactory().createUserAgentHeader(agentParam); }