fix(接口测试): 旧版 POST 请求query参数及URL中无法使用变量

This commit is contained in:
Captain.B 2021-04-25 09:54:49 +08:00 committed by 刘瑞斌
parent 49cc34b040
commit 57bb0a7a5e
2 changed files with 10 additions and 7 deletions

View File

@ -156,12 +156,15 @@ public class JmeterDocumentParser {
if (!StringUtils.equals("?", u)) {
u += "&";
}
v = ScriptEngineUtils.calculate(v);
// urlencoder
try {
v = URLEncoder.encode(v, "UTF-8");
} catch (UnsupportedEncodingException e) {
LogUtil.error(e);
// 排除 jmeter 内置的函数
if (!v.startsWith("$")) {
v = ScriptEngineUtils.calculate(v);
// urlencoder
try {
v = URLEncoder.encode(v, "UTF-8");
} catch (UnsupportedEncodingException e) {
LogUtil.error(e);
}
}
u += k + "=" + v;
return u;

@ -1 +1 @@
Subproject commit e4b1f5838f00791b42b394ad00a365a14f28be83
Subproject commit e7709b9a340394e78610b91105b2cec0f1b8289d