1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-06-17 22:37:33 +02:00

Reset config at the start of config.Configure()

This commit is contained in:
DarthSim
2024-04-30 16:51:02 +03:00
parent e0ea0ba6e1
commit 13d311fd1a
2 changed files with 4 additions and 3 deletions

View File

@ -389,6 +389,8 @@ func Reset() {
} }
func Configure() error { func Configure() error {
Reset()
if port := os.Getenv("PORT"); len(port) > 0 { if port := os.Getenv("PORT"); len(port) > 0 {
Bind = fmt.Sprintf(":%s", port) Bind = fmt.Sprintf(":%s", port)
} }

View File

@ -40,9 +40,8 @@ func (s *ProcessingHandlerTestSuite) SetupSuite() {
wd, err := os.Getwd() wd, err := os.Getwd()
s.Require().NoError(err) s.Require().NoError(err)
config.LocalFileSystemRoot = filepath.Join(wd, "/testdata") s.T().Setenv("IMGPROXY_LOCAL_FILESYSTEM_ROOT", filepath.Join(wd, "/testdata"))
// Disable keep-alive to test connection restrictions s.T().Setenv("IMGPROXY_CLIENT_KEEP_ALIVE_TIMEOUT", "0")
config.ClientKeepAliveTimeout = 0
err = initialize() err = initialize()
s.Require().NoError(err) s.Require().NoError(err)