fix: query参数可以传空值
This commit is contained in:
parent
faaf58decf
commit
5d167e10d5
|
@ -272,10 +272,14 @@ public class MsHTTPSamplerProxy extends MsTestElement {
|
|||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(path);
|
||||
stringBuffer.append("?");
|
||||
this.getArguments().stream().filter(KeyValue::isEnable).filter(KeyValue::isValid).forEach(keyValue ->
|
||||
stringBuffer.append(keyValue.getName()).append("=").append(keyValue.getValue() != null && keyValue.getValue().startsWith("@") ?
|
||||
ScriptEngineUtils.calculate(keyValue.getValue()) : keyValue.getValue()).append("&")
|
||||
);
|
||||
this.getArguments().stream().filter(KeyValue::isEnable).filter(KeyValue::isValid).forEach(keyValue -> {
|
||||
stringBuffer.append(keyValue.getName());
|
||||
if (keyValue.getValue() != null) {
|
||||
stringBuffer.append("=").append(keyValue.getValue().startsWith("@") ?
|
||||
ScriptEngineUtils.calculate(keyValue.getValue()) : keyValue.getValue());
|
||||
}
|
||||
stringBuffer.append("&");
|
||||
});
|
||||
return stringBuffer.substring(0, stringBuffer.length() - 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class KeyValue {
|
|||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return ((StringUtils.isNotBlank(name) && StringUtils.isNotBlank(value)) || "JSON-SCHEMA".equals(type)) && !StringUtils.equalsIgnoreCase(type, "file");
|
||||
return (StringUtils.isNotBlank(name) || "JSON-SCHEMA".equals(type)) && !StringUtils.equalsIgnoreCase(type, "file");
|
||||
}
|
||||
|
||||
public boolean isFile() {
|
||||
|
|
Loading…
Reference in New Issue