From b484e56eb530371d10dbe5435c506e57e2994c18 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 18 Feb 2022 16:35:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=E6=89=A7=E8=A1=8C=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=8C=B9=E9=85=8D=E5=A4=9A=E5=87=BA=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010400 --user=赵勇 【接口测试】环境模块匹配,匹配不到域名的接口,调试的时候多了个端口号 https://www.tapd.cn/55049933/s/1105831 --- .../api/dto/definition/request/sampler/MsHTTPSamplerProxy.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java index 5ffb469dca..a48936b2b4 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java @@ -421,14 +421,15 @@ public class MsHTTPSamplerProxy extends MsTestElement { if (StringUtils.isNotBlank(this.getPath())) { envPath += this.getPath(); } + sampler.setPort(httpConfig.getPort()); if (StringUtils.isNotEmpty(httpConfig.getDomain())) { sampler.setDomain(URLDecoder.decode(httpConfig.getDomain(), "UTF-8")); sampler.setProtocol(httpConfig.getProtocol()); } else { sampler.setDomain(""); sampler.setProtocol(""); + sampler.setPort(-1); } - sampler.setPort(httpConfig.getPort()); } else { URL urlObject = new URL(this.path); envPath = StringUtils.equals(urlObject.getPath(), "/") ? "" : urlObject.getFile();