From 3c94ff6a3532811c0fa1bbdfc3b8f6785871a95e Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Sun, 5 Sep 2021 10:02:05 +0100 Subject: [PATCH] add default settings for transport and security --- infra/conf/v5cfg/stream.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/infra/conf/v5cfg/stream.go b/infra/conf/v5cfg/stream.go index d907a6843..a8443d99a 100644 --- a/infra/conf/v5cfg/stream.go +++ b/infra/conf/v5cfg/stream.go @@ -17,6 +17,9 @@ func (s StreamConfig) BuildV5(ctx context.Context) (proto.Message, error) { s.Security = "none" } + if s.TransportSettings == nil { + s.TransportSettings = []byte("{}") + } transportConfigPack, err := loadHeterogeneousConfigFromRawJson("transport", s.Transport, s.TransportSettings) if err != nil { return nil, newError("unable to load transport config").Base(err) @@ -28,6 +31,9 @@ func (s StreamConfig) BuildV5(ctx context.Context) (proto.Message, error) { Settings: serial.ToTypedMessage(transportConfigPack), }) + if s.SecuritySettings == nil { + s.SecuritySettings = []byte("{}") + } securityConfigPack, err := loadHeterogeneousConfigFromRawJson("security", s.Security, s.SecuritySettings) if err != nil { return nil, newError("unable to load security config").Base(err)