http: fix cache configuration marshal/unmarshal

Also, enable Redis by default, as stated in changelog.
This commit is contained in:
Vincent Bernat
2022-12-22 18:22:53 +01:00
parent 07a7524f8d
commit 4db5ac7544
3 changed files with 15 additions and 1 deletions

View File

@@ -144,7 +144,7 @@ func ParametrizedConfigurationUnmarshallerHook[OuterConfiguration any, InnerConf
// Alter config with a copy of the concrete type
defaultV := innerConfiguration()
original := reflect.Indirect(reflect.ValueOf(defaultV))
if !configField.IsNil() && configField.Elem().Type().Elem() == reflect.TypeOf(defaultV).Elem() {
if !configField.IsNil() && configField.Elem().Type() == reflect.TypeOf(defaultV) {
// Use the value we already have instead of default.
original = reflect.Indirect(configField.Elem())
}