浏览代码

Fix "Fix metadata context"

世界 11 月之前
父节点
当前提交
b460484e43
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      outbound/builder.go

+ 5 - 0
outbound/builder.go

@@ -11,6 +11,11 @@ import (
 )
 
 func New(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.Outbound) (adapter.Outbound, error) {
+	if tag != "" {
+		ctx = adapter.WithContext(ctx, &adapter.InboundContext{
+			Outbound: tag,
+		})
+	}
 	if options.Type == "" {
 		return nil, E.New("missing outbound type")
 	}