fix(接口测试): 修复QUERY参数拼接到URL中出现换行问题

--bug=1012001 --user=赵勇 [接口定义]github#12376接口定义,使用批量添加的参数,执行时url拼接的参数都会添加上换行符 https://www.tapd.cn/55049933/s/1131779
This commit is contained in:
fit2-zhao 2022-04-08 15:08:28 +08:00 committed by 刘瑞斌
parent 60cf1f8b33
commit afd942c2ac
1 changed files with 4 additions and 0 deletions

View File

@ -654,6 +654,10 @@ public class MsHTTPSamplerProxy extends MsTestElement {
try {
String value = keyValue.getValue().startsWith("@") ? ScriptEngineUtils.buildFunctionCallString(keyValue.getValue()) : keyValue.getValue();
value = keyValue.isUrlEncode() ? "${__urlencode(" + value + ")}" : value;
if (StringUtils.isNotEmpty(value) && value.contains("\r")) {
value = value.replaceAll("\r", "");
}
stringBuffer.append("=").append(value);
} catch (Exception e) {
LogUtil.error(e);