From c14634548c5ffb3103a7ea51e7a38b44ce283751 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 1 Apr 2021 18:08:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E5=AF=BC=E5=85=A5JMX=E6=97=A0=E5=85=A8=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/dto/automation/parse/MsJmeterParser.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java index e995df3c49..6ca5d6d0fc 100644 --- a/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java +++ b/backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java @@ -153,6 +153,10 @@ public class MsJmeterParser extends ApiImportAbstractParser { public String getUrl(HTTPSamplerProxy source) throws MalformedURLException { String path = source.getPath(); + // Request Defaults + if (StringUtils.isEmpty(source.getDomain())) { + return null; + } if (!path.startsWith("http://") && !path.startsWith("https://")) { String domain = source.getDomain(); String protocol = source.getProtocol(); @@ -214,8 +218,8 @@ public class MsJmeterParser extends ApiImportAbstractParser { samplerProxy.getBody().setKvs(keyValues); } samplerProxy.setProtocol(RequestType.HTTP); - samplerProxy.setConnectTimeout(source.getConnectTimeout()+""); - samplerProxy.setResponseTimeout(source.getResponseTimeout()+""); + samplerProxy.setConnectTimeout(source.getConnectTimeout() + ""); + samplerProxy.setResponseTimeout(source.getResponseTimeout() + ""); samplerProxy.setPort(source.getPropertyAsString("HTTPSampler.port")); samplerProxy.setDomain(source.getDomain()); if (source.getArguments() != null) {