瀏覽代碼

fixed processing none security subscription

Shelikhoo 2 年之前
父節點
當前提交
a07572822a
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/subscription/specs/outbound_parser.go

+ 2 - 2
app/subscription/specs/outbound_parser.go

@@ -55,7 +55,7 @@ func (p *OutboundParser) toAbstractServerSpec(config *OutboundConfig) (*ServerCo
 			}
 			}
 			serverConfig.TransportSettings = serial.ToTypedMessage(transportSettings)
 			serverConfig.TransportSettings = serial.ToTypedMessage(transportSettings)
 		}
 		}
-		{
+		if config.StreamSetting.Security != "none" {
 			securitySettings, err := loadHeterogeneousConfigFromRawJSONRestricted(
 			securitySettings, err := loadHeterogeneousConfigFromRawJSONRestricted(
 				"security", config.StreamSetting.Security, config.StreamSetting.SecuritySettings)
 				"security", config.StreamSetting.Security, config.StreamSetting.SecuritySettings)
 			if err != nil {
 			if err != nil {
@@ -72,7 +72,7 @@ func (p *OutboundParser) toAbstractServerSpec(config *OutboundConfig) (*ServerCo
 func (p *OutboundParser) ToSubscriptionServerConfig(config *OutboundConfig) (*SubscriptionServerConfig, error) {
 func (p *OutboundParser) ToSubscriptionServerConfig(config *OutboundConfig) (*SubscriptionServerConfig, error) {
 	serverSpec, err := p.toAbstractServerSpec(config)
 	serverSpec, err := p.toAbstractServerSpec(config)
 	if err != nil {
 	if err != nil {
-		return nil, newError("unable to parse server specification")
+		return nil, newError("unable to parse server specification").Base(err)
 	}
 	}
 	return &SubscriptionServerConfig{
 	return &SubscriptionServerConfig{
 		Configuration: serverSpec,
 		Configuration: serverSpec,