mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 13:42:02 +08:00
Bump to 0.12.0 (#345)
This commit is contained in:
parent
89ea0affa3
commit
d29959cbd4
@ -51,7 +51,7 @@ var (
|
|||||||
ProxyMode bool
|
ProxyMode bool
|
||||||
Prefetch bool
|
Prefetch bool
|
||||||
Config = NewWebPConfig()
|
Config = NewWebPConfig()
|
||||||
Version = "0.11.4"
|
Version = "0.12.0"
|
||||||
WriteLock = cache.New(5*time.Minute, 10*time.Minute)
|
WriteLock = cache.New(5*time.Minute, 10*time.Minute)
|
||||||
ConvertLock = cache.New(5*time.Minute, 10*time.Minute)
|
ConvertLock = cache.New(5*time.Minute, 10*time.Minute)
|
||||||
LocalHostAlias = "local"
|
LocalHostAlias = "local"
|
||||||
|
@ -22,6 +22,7 @@ func TestLoadConfig(t *testing.T) {
|
|||||||
assert.Equal(t, Config.ImageMap, map[string]string{})
|
assert.Equal(t, Config.ImageMap, map[string]string{})
|
||||||
assert.Equal(t, Config.ExhaustPath, "./exhaust")
|
assert.Equal(t, Config.ExhaustPath, "./exhaust")
|
||||||
assert.Equal(t, Config.CacheTTL, 259200)
|
assert.Equal(t, Config.CacheTTL, 259200)
|
||||||
|
assert.Equal(t, Config.MaxCacheSize, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSwitchProxyMode(t *testing.T) {
|
func TestSwitchProxyMode(t *testing.T) {
|
||||||
@ -35,14 +36,14 @@ func TestSwitchProxyMode(t *testing.T) {
|
|||||||
func TestParseImgMap(t *testing.T) {
|
func TestParseImgMap(t *testing.T) {
|
||||||
empty := map[string]string{}
|
empty := map[string]string{}
|
||||||
good := map[string]string{
|
good := map[string]string{
|
||||||
"/1": "../pics/dir1",
|
"/1": "../pics/dir1",
|
||||||
"http://example.com": "../pics",
|
"http://example.com": "../pics",
|
||||||
"https://example.com": "../pics",
|
"https://example.com": "../pics",
|
||||||
}
|
}
|
||||||
bad := map[string]string{
|
bad := map[string]string{
|
||||||
"1": "../pics/dir1",
|
"1": "../pics/dir1",
|
||||||
"httpx://example.com": "../pics",
|
"httpx://example.com": "../pics",
|
||||||
"ftp://example.com": "../pics",
|
"ftp://example.com": "../pics",
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equal(t, empty, parseImgMap(empty))
|
assert.Equal(t, empty, parseImgMap(empty))
|
||||||
|
2
go.mod
2
go.mod
@ -19,7 +19,7 @@ require (
|
|||||||
require (
|
require (
|
||||||
github.com/andybalholm/brotli v1.1.0 // indirect
|
github.com/andybalholm/brotli v1.1.0 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/google/uuid v1.5.0 // indirect
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
github.com/klauspost/compress v1.17.9 // indirect
|
github.com/klauspost/compress v1.17.9 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
|
2
go.sum
2
go.sum
@ -13,6 +13,8 @@ github.com/gofiber/fiber/v2 v2.52.4 h1:P+T+4iK7VaqUsq2PALYEfBBo6bJZ4q3FP8cZ84Egg
|
|||||||
github.com/gofiber/fiber/v2 v2.52.4/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ=
|
github.com/gofiber/fiber/v2 v2.52.4/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ=
|
||||||
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
|
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
|
||||||
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/h2non/filetype v1.1.4-0.20230123234534-cfcd7d097bc4 h1:k7FGP5I7raiaC3aAzCLddcoxzboIrOm6/FVRXjp/5JM=
|
github.com/h2non/filetype v1.1.4-0.20230123234534-cfcd7d097bc4 h1:k7FGP5I7raiaC3aAzCLddcoxzboIrOm6/FVRXjp/5JM=
|
||||||
github.com/h2non/filetype v1.1.4-0.20230123234534-cfcd7d097bc4/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY=
|
github.com/h2non/filetype v1.1.4-0.20230123234534-cfcd7d097bc4/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY=
|
||||||
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c h1:fEE5/5VNnYUoBOj2I9TP8Jc+a7lge3QWn9DKE7NCwfc=
|
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c h1:fEE5/5VNnYUoBOj2I9TP8Jc+a7lge3QWn9DKE7NCwfc=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user