mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-25 20:40:24 +08:00
例外和限制URL中增加常见图片、常见音频、常见视频等规则
This commit is contained in:
@@ -118,6 +118,46 @@ func TestURLPattern_Match(t *testing.T) {
|
||||
url: "https://example.com/123456/789",
|
||||
result: false,
|
||||
},
|
||||
{
|
||||
patternType: "images",
|
||||
url: "https://example.com/images/logo.png",
|
||||
result: true,
|
||||
},
|
||||
{
|
||||
patternType: "images",
|
||||
url: "https://example.com/images/logo.webp",
|
||||
result: true,
|
||||
},
|
||||
{
|
||||
patternType: "images",
|
||||
url: "https://example.com/images/logo.mp3",
|
||||
result: false,
|
||||
},
|
||||
{
|
||||
patternType: "audios",
|
||||
url: "https://example.com/audios/music.mp3",
|
||||
result: true,
|
||||
},
|
||||
{
|
||||
patternType: "audios",
|
||||
url: "https://example.com/audios/music.mm",
|
||||
result: false,
|
||||
},
|
||||
{
|
||||
patternType: "videos",
|
||||
url: "https://example.com/images/movie.mp4",
|
||||
result: true,
|
||||
},
|
||||
{
|
||||
patternType: "videos",
|
||||
url: "https://example.com/images/movie.ts",
|
||||
result: true,
|
||||
},
|
||||
{
|
||||
patternType: "videos",
|
||||
url: "https://example.com/images/movie.mp5",
|
||||
result: false,
|
||||
},
|
||||
} {
|
||||
var p = &shared.URLPattern{
|
||||
Type: ut.patternType,
|
||||
|
||||
Reference in New Issue
Block a user