servewaf's and rproxy's settings are read through viper, bound to the same environment variable names as before, in place of the os.LookupEnv function Main passed down. NewViper turns AutomaticEnv and AllowEmptyEnv on, so a setting that is set but empty reads as set, as it did. A setting may also be given as a file, the _FILE form, which rproxy's settings now have too; rproxy still writes nothing to disk. The settings tests pass set into a viper instead of a lookup function. Model: deepseek-v4-pro
This commit is contained in:
1 parent
2e2f6f7175
commit
3fa1f4b732
19 files changed
+274
-185
No files matched your search
@@ -33,13 +33,9 @@ func announcedLength(size int) string {
|
||||
func TestServerHasTheFixedLimits(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
cfg, err := config.RProxyFromEnvironment(func(name string) (string, bool) {
|
||||
if name == "SWRP_WAF_BACKEND" {
|
||||
return nowhere, true
|
||||
}
|
||||
|
||||
return "", false
|
||||
})
|
||||
cfg, err := config.RProxyFromEnvironment(viperFrom(map[string]string{
|
||||
"SWRP_WAF_BACKEND": nowhere,
|
||||
}))
|
||||
if err != nil {
|
||||
t.Fatalf("settings: %v", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user