Jelajahi Sumber

Fix inbound nil context info

风扇滑翔翼 3 bulan lalu
induk
melakukan
fcc87411d2
1 mengubah file dengan 3 tambahan dan 0 penghapusan
  1. 3 0
      proxy/loopback/loopback.go

+ 3 - 0
proxy/loopback/loopback.go

@@ -46,6 +46,9 @@ func (l *Loopback) Process(ctx context.Context, link *transport.Link, _ internet
 		ctx = session.ContextWithContent(ctx, content)
 
 		inbound := session.InboundFromContext(ctx)
+		if inbound == nil {
+			inbound = &session.Inbound{}
+		}
 
 		inbound.Tag = l.config.InboundTag