From b262b60c2c892d212f9a9afd1d6c26b7111b0bb2 Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Mon, 8 Apr 2024 11:30:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AEhost=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/parser/jmeter/MsHTTPElementConverter.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java index a3412e7aaf..116360b165 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java @@ -474,8 +474,13 @@ public class MsHTTPElementConverter extends AbstractJmeterElementConverter -1) { + domain = domain.substring(0, index); + } + List hosts = new ArrayList<>(); - envConfig.getConfig().getHostConfig().getHosts().forEach(host -> { + for (Host host : envConfig.getConfig().getHostConfig().getHosts()) { if (StringUtils.isNotBlank(host.getDomain())) { String hostDomain = host.getDomain().trim().replace(HTTP, StringUtils.EMPTY).replace(HTTPS, StringUtils.EMPTY); if (StringUtils.equals(hostDomain, domain)) { @@ -483,7 +488,8 @@ public class MsHTTPElementConverter extends AbstractJmeterElementConverter