Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
190c4966b2
|
@ -21,6 +21,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -75,6 +76,11 @@ public class HarParser extends HarAbstractParser {
|
|||
if (harRequest.url != null) {
|
||||
String[] nameArr = harRequest.url.split("/");
|
||||
reqName = nameArr[nameArr.length - 1];
|
||||
//然后进行转码解码
|
||||
try {
|
||||
reqName = URLDecoder.decode(reqName,"UTF-8");
|
||||
}catch (Exception e){
|
||||
}
|
||||
}
|
||||
|
||||
if (harRequest != null) {
|
||||
|
|
|
@ -29,6 +29,9 @@ import org.apache.commons.lang3.StringUtils;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* Utility class for working with HAR files.
|
||||
|
@ -51,4 +54,13 @@ public class HarUtils {
|
|||
Har har = JSONObject.parseObject(harJson, Har.class);
|
||||
return har;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws UnsupportedEncodingException {
|
||||
// String str = "%E6%B5%8B%AF";
|
||||
String str = "测试";
|
||||
str = URLEncoder.encode(str,"UTF-8");
|
||||
System.out.println(str);
|
||||
str = URLDecoder.decode(str,"UTF-8");
|
||||
System.out.println(str);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue