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);