refactor(接口测试): 接口定义导入 har 文件报错修复
--bug=1009828 --user=周骏弘 【接口测试】github#9732,导入har包报错 https://www.tapd.cn/55049933/s/1099430
This commit is contained in:
parent
3dd81a000d
commit
3bc4fe38ad
|
@ -243,8 +243,10 @@ public class HarParser extends HarAbstractParser {
|
|||
return;
|
||||
}
|
||||
String contentType = content.mimeType;
|
||||
body.setType(getBodyType(contentType));
|
||||
body.setRaw(content.text);
|
||||
if(body != null){
|
||||
body.setType(getBodyType(contentType));
|
||||
body.setRaw(content.text);
|
||||
}
|
||||
}
|
||||
|
||||
private String parseXmlBody(String xmlString) {
|
||||
|
|
|
@ -37,10 +37,13 @@ public class Body {
|
|||
|
||||
public boolean isValid() {
|
||||
if (this.isKV()) {
|
||||
return kvs.stream().anyMatch(KeyValue::isValid);
|
||||
if(kvs != null){
|
||||
return kvs.stream().anyMatch(KeyValue::isValid);
|
||||
}
|
||||
} else {
|
||||
return StringUtils.isNotBlank(raw);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isKV() {
|
||||
|
|
Loading…
Reference in New Issue