mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-04-12 20:06:54 +00:00
Compare commits
2 Commits
main
...
copilot/op
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a45a64380c | ||
|
|
df7442c3dd |
@@ -113,9 +113,9 @@ public enum PanDomainTemplate {
|
||||
"https://www.feijix.com/s/{shareKey}",
|
||||
FjTool.class),
|
||||
|
||||
// https://lecloud.lenovo.com/share/
|
||||
// https://lecloud.lenovo.com/share/ https://lecloud.lenovo.com/mshare/
|
||||
LE("联想乐云",
|
||||
compile("https://lecloud?\\.lenovo\\.com/share/(?<KEY>.+)"),
|
||||
compile("https://lecloud?\\.lenovo\\.com/m?share/(?<KEY>.+)"),
|
||||
"https://lecloud.lenovo.com/share/{shareKey}",
|
||||
LeTool.class),
|
||||
|
||||
|
||||
@@ -129,6 +129,25 @@ public class PanDomainTemplateTest {
|
||||
wsPattern.matcher("https://www.evil.com/f/abc123").matches());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLePatternMatching() {
|
||||
Pattern lePattern = PanDomainTemplate.LE.getPattern();
|
||||
|
||||
// /share/ 格式
|
||||
Matcher m1 = lePattern.matcher("https://lecloud.lenovo.com/share/abc123");
|
||||
assertTrue("LE pattern should match /share/ format", m1.matches());
|
||||
assertEquals("abc123", m1.group("KEY"));
|
||||
|
||||
// /mshare/ 格式
|
||||
Matcher m2 = lePattern.matcher("https://lecloud.lenovo.com/mshare/xyz789");
|
||||
assertTrue("LE pattern should match /mshare/ format", m2.matches());
|
||||
assertEquals("xyz789", m2.group("KEY"));
|
||||
|
||||
// 负例:错误路径不匹配
|
||||
assertFalse("Wrong path should not match",
|
||||
lePattern.matcher("https://lecloud.lenovo.com/s/abc123").matches());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyDuplicates() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user