This commit is contained in:
Looly 2021-12-21 18:52:40 +08:00
parent ed85cd3cac
commit 3824c61596
3 changed files with 17 additions and 2 deletions

View File

@ -3,7 +3,7 @@
-------------------------------------------------------------------------------------------------------------
# 5.7.18 (2021-12-20)
# 5.7.18 (2021-12-21)
### 🐣新特性
* 【core 】 新增CollStreamUtil.groupKeyValuepr#479@Gitee
@ -20,6 +20,7 @@
* 【json 】 修复JSONObject 初始化大小值未被使用问题issue#2016@Github
* 【core 】 修复StrUtil.startWith都为null返回错误问题issue#I4MV7Q@Gitee
* 【core 】 修复PasswdStrength检测问题issue#I4N48X@Gitee
* 【core 】 修复UserAgentUtil解析EdgA无法识别问题issue#I4MCBP@Gitee
-------------------------------------------------------------------------------------------------------------
# 5.7.17 (2021-12-09)

View File

@ -48,7 +48,7 @@ public class Browser extends UserAgentInfo {
// 夸克浏览器
new Browser("Quark", "Quark", Other_Version),
new Browser("MSEdge", "Edge|Edg", "(?:edge|Edg)\\/([\\d\\w\\.\\-]+)"),
new Browser("MSEdge", "Edge|Edg", "(?:edge|Edg|EdgA)\\/([\\d\\w\\.\\-]+)"),
new Browser("Chrome", "chrome", Other_Version),
new Browser("Firefox", "firefox", Other_Version),
new Browser("IEMobile", "iemobile", Other_Version),

View File

@ -359,4 +359,18 @@ public class UserAgentUtilTest {
Assert.assertTrue(ua.isMobile());
}
@Test
public void parseEdgATest(){
// https://gitee.com/dromara/hutool/issues/I4MCBP
String uaStr = "userAgent: Mozilla/5.0 (Linux; Android 11; MI 9 Transparent Edition) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Mobile Safari/537.36 EdgA/96.0.1054.36";
final UserAgent ua = UserAgentUtil.parse(uaStr);
Assert.assertEquals("MSEdge", ua.getBrowser().toString());
Assert.assertEquals("96.0.1054.36", ua.getVersion());
Assert.assertEquals("Webkit", ua.getEngine().toString());
Assert.assertEquals("537.36", ua.getEngineVersion());
Assert.assertEquals("Android", ua.getOs().toString());
Assert.assertEquals("11", ua.getOsVersion());
Assert.assertEquals("Android", ua.getPlatform().toString());
Assert.assertTrue(ua.isMobile());
}
}