diff --git a/config/config.go b/config/config.go index dd1e5578c..95da7dc61 100644 --- a/config/config.go +++ b/config/config.go @@ -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" diff --git a/config/config_test.go b/config/config_test.go index 50d28ccb7..9ef00160f 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -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) { @@ -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)) @@ -53,4 +54,4 @@ func TestParseImgMap(t *testing.T) { bad[k] = v } assert.Equal(t, good, parseImgMap(bad)) -} \ No newline at end of file +} diff --git a/go.mod b/go.mod index b121495b2..f9d30cb44 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index c045e2f63..4ac2cbcbb 100644 --- a/go.sum +++ b/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/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=