mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-05 21:06:38 +08:00
bug处理
bug处理
This commit is contained in:
@@ -299,3 +299,26 @@ func TestImageProxyDoesNotCacheMislabeledRemoteResponse(t *testing.T) {
|
||||
t.Fatalf("upstream calls = %d, want 1", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemoteImageRefererForAdultHosts(t *testing.T) {
|
||||
tests := []struct {
|
||||
host string
|
||||
want string
|
||||
}{
|
||||
{"www.javbus.com", "https://www.javbus.com/"},
|
||||
{"pics.dmm.co.jp", "https://www.dmm.co.jp/"},
|
||||
{"javdb.com", "https://javdb.com/"},
|
||||
{"image.mgstage.com", "https://www.mgstage.com/"},
|
||||
{"img.faleno.jp", "https://faleno.jp/"},
|
||||
{"adult.contents.fc2.com", "https://adult.contents.fc2.com/"},
|
||||
{"img1.doubanio.com", "https://movie.douban.com/"},
|
||||
{"lain.bgm.tv", "https://bgm.tv/"},
|
||||
{"example.com", "https://example.com/"},
|
||||
{"", ""},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
if got := remoteImageReferer(tt.host); got != tt.want {
|
||||
t.Errorf("remoteImageReferer(%q) = %q, want %q", tt.host, got, tt.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user