From 1440e64a7309a61fef5ae65845cfb9b826ce1006 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 31 Mar 2023 19:24:04 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96http=E5=8F=98=E9=87=8F=E5=8F=96ip=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/definition/request/sampler/MsHTTPSamplerProxy.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java index 4455688144..332e556973 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java @@ -425,10 +425,13 @@ public class MsHTTPSamplerProxy extends MsTestElement { envPath += this.getPath(); } sampler.setPort(httpConfig.getPort()); - if (StringUtils.isNotEmpty(httpConfig.getDomain())) { + if (httpConfig.getDomain().startsWith("${")){ + sampler.setProtocol(httpConfig.getProtocol()); + envPath = StringUtils.isNotBlank(this.path) ? StringUtils.join(httpConfig.getSocket(), this.path) : url; + } else if (StringUtils.isNotEmpty(httpConfig.getDomain())) { sampler.setDomain(URLDecoder.decode(httpConfig.getDomain(), StandardCharsets.UTF_8.name())); sampler.setProtocol(httpConfig.getProtocol()); - } else { + } else { sampler.setDomain(""); sampler.setProtocol(""); sampler.setPort(-1);