From f1b8bf4c9f1b6fda63a18301c75e0b336d91fc39 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 19 Aug 2020 17:39:40 +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=20post=20url=20=E6=A0=BC=E5=BC=8F=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/api/parse/JmeterDocumentParser.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java b/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java index d6aa1c845d..a503c96b7f 100644 --- a/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java +++ b/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java @@ -149,9 +149,14 @@ public class JmeterDocumentParser { String path = ele.getTextContent(); Map parser = parserUrl(path); String url = parser.get("URL"); - String params = parser.keySet().stream().filter(k -> !"URL".equals(k)).reduce("", (u, k) -> { + String params = parser.keySet().stream().filter(k -> !"URL".equals(k)).reduce("?", (u, k) -> { String v = parser.get(k); - u += "&" + k + "=" + ScriptEngineUtils.calculate(v); + if ("?".equals(u)) { + u += ""; + } else { + u += "&"; + } + u += k + "=" + ScriptEngineUtils.calculate(v); return u; }); ele.setTextContent(url + params);