From 10e2180c72d0f683cf08a4bc586aa8960b2a6d5c Mon Sep 17 00:00:00 2001 From: leesam Date: Wed, 10 Apr 2024 19:07:37 +0800 Subject: [PATCH] =?UTF-8?q?[bugfix]=E6=94=AF=E6=8C=81context-path=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/media/zlm/ZLMMediaServerStatusManger.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaServerStatusManger.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaServerStatusManger.java index d744850d..cdf1e3f2 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaServerStatusManger.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaServerStatusManger.java @@ -55,6 +55,9 @@ public class ZLMMediaServerStatusManger { @Value("${server.port}") private Integer serverPort; + @Value("${server.servlet.context-path:}") + private String serverServletContextPath; + @Autowired private UserSetting userSetting; @@ -239,7 +242,7 @@ public class ZLMMediaServerStatusManger { logger.info("[媒体服务节点] 正在设置 :{} -> {}:{}", mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); String protocol = sslEnabled ? "https" : "http"; - String hookPrefix = String.format("%s://%s:%s/index/hook", protocol, mediaServerItem.getHookIp(), serverPort); + String hookPrefix = String.format("%s://%s:%s%s/index/hook", protocol, mediaServerItem.getHookIp(), serverPort, (serverServletContextPath == null || "/".equals(serverServletContextPath)) ? "" : serverServletContextPath); Map param = new HashMap<>(); param.put("api.secret",mediaServerItem.getSecret()); // -profile:v Baseline