From b460484e436e67c6971fec1b8ddd2c1f53476338 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= <i@sekai.icu>
Date: Sat, 2 Nov 2024 21:37:04 +0800
Subject: [PATCH] Fix "Fix metadata context"

---
 outbound/builder.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/outbound/builder.go b/outbound/builder.go
index b99b49b7..d895b56d 100644
--- a/outbound/builder.go
+++ b/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")
 	}