fix(接口测试): 修复参数名编码不生效的缺陷
--bug=1020647 --user=王孝刚 【接口测试】请求参数-参数名编码没生效 https://www.tapd.cn/55049933/s/1314352
This commit is contained in:
parent
8650503286
commit
877f6311dd
|
@ -555,8 +555,9 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
|||
try {
|
||||
String value = keyValue.getValue() != null && keyValue.getValue().startsWith("@") ?
|
||||
ScriptEngineUtils.buildFunctionCallString(keyValue.getValue()) : keyValue.getValue();
|
||||
value = keyValue.isUrlEncode() ? "${__urlencode(" + value + ")}" : value;
|
||||
keyValueMap.put(keyValue.getName(), value);
|
||||
value = keyValue.isUrlEncode() ? StringUtils.join(StringUtils.join("${__urlencode(", value), ")}") : value;
|
||||
String key = keyValue.isUrlEncode() ? StringUtils.join(StringUtils.join("${__urlencode(", keyValue.getName()), ")}") : keyValue.getName();
|
||||
keyValueMap.put(key, value);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
|
@ -586,11 +587,11 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
|||
stringBuffer.append("?");
|
||||
}
|
||||
this.getArguments().stream().filter(KeyValue::isEnable).filter(KeyValue::isValid).forEach(keyValue -> {
|
||||
stringBuffer.append(keyValue.getName());
|
||||
stringBuffer.append(keyValue.isUrlEncode() ? StringUtils.join(StringUtils.join("${__urlencode(", keyValue.getName()), ")}") : keyValue.getName());
|
||||
if (keyValue.getValue() != null) {
|
||||
try {
|
||||
String value = keyValue.getValue().startsWith("@") ? ScriptEngineUtils.buildFunctionCallString(keyValue.getValue()) : keyValue.getValue();
|
||||
value = keyValue.isUrlEncode() ? "${__urlencode(" + value + ")}" : value;
|
||||
value = keyValue.isUrlEncode() ? StringUtils.join(StringUtils.join("${__urlencode(", value), ")}") : value;
|
||||
if (StringUtils.isNotEmpty(value) && value.contains(StringUtils.CR)) {
|
||||
value = value.replaceAll(StringUtils.CR, StringUtils.EMPTY);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue