Skip to content

Commit

Permalink
Bump to 0.12.0 (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
n0vad3v committed Jun 29, 2024
1 parent 89ea0af commit d29959c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var (
ProxyMode bool
Prefetch bool
Config = NewWebPConfig()
Version = "0.11.4"
Version = "0.12.0"
WriteLock = cache.New(5*time.Minute, 10*time.Minute)
ConvertLock = cache.New(5*time.Minute, 10*time.Minute)
LocalHostAlias = "local"
Expand Down
13 changes: 7 additions & 6 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func TestLoadConfig(t *testing.T) {
assert.Equal(t, Config.ImageMap, map[string]string{})
assert.Equal(t, Config.ExhaustPath, "./exhaust")
assert.Equal(t, Config.CacheTTL, 259200)
assert.Equal(t, Config.MaxCacheSize, 0)
}

func TestSwitchProxyMode(t *testing.T) {
Expand All @@ -35,16 +36,16 @@ func TestSwitchProxyMode(t *testing.T) {
func TestParseImgMap(t *testing.T) {
empty := map[string]string{}
good := map[string]string{
"/1": "../pics/dir1",
"http://example.com": "../pics",
"/1": "../pics/dir1",
"http://example.com": "../pics",
"https://example.com": "../pics",
}
bad := map[string]string{
"1": "../pics/dir1",
"1": "../pics/dir1",
"httpx://example.com": "../pics",
"ftp://example.com": "../pics",
"ftp://example.com": "../pics",
}

assert.Equal(t, empty, parseImgMap(empty))
assert.Equal(t, empty, parseImgMap(bad))
assert.Equal(t, good, parseImgMap(good))
Expand All @@ -53,4 +54,4 @@ func TestParseImgMap(t *testing.T) {
bad[k] = v
}
assert.Equal(t, good, parseImgMap(bad))
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
require (
github.com/andybalholm/brotli v1.1.0 // 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/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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/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.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/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY=
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c h1:fEE5/5VNnYUoBOj2I9TP8Jc+a7lge3QWn9DKE7NCwfc=
Expand Down

0 comments on commit d29959c

Please sign in to comment.