From 062db32e77a1826f5245574140a9457d83cf7f18 Mon Sep 17 00:00:00 2001 From: Thomas Leplus Date: Thu, 16 Sep 2021 23:28:32 -0700 Subject: [PATCH] Use replaceAll() return value The replaceAll() method returns the result. It does not modify the current string. --- .../api/dto/definition/request/sampler/MsHTTPSamplerProxy.java | 2 +- 1 file changed, 1 insertion(+), 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 3a80c1ea8b..9de878cb72 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 @@ -465,7 +465,7 @@ public class MsHTTPSamplerProxy extends MsTestElement { url = "http://" + url; } if (StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) { - url.replaceAll(this.getPort(), "10990"); + url = url.replaceAll(this.getPort(), "10990"); } if (url == null) { MSException.throwException("请重新选择环境");