Skip to content

Commit bd04667

Browse files
committed
TUN-7158: Correct TCP tracing propagation
Previously QUIC would send TCP tracing response header that was empty regardless if prompted from origintunneld.
1 parent 8a9f076 commit bd04667

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

connection/quic.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,16 @@ type streamReadWriteAcker struct {
383383

384384
// AckConnection acks response back to the proxy.
385385
func (s *streamReadWriteAcker) AckConnection(tracePropagation string) error {
386-
metadata := quicpogs.Metadata{
387-
Key: tracing.CanonicalCloudflaredTracingHeader,
388-
Val: tracePropagation,
386+
metadata := []quicpogs.Metadata{}
387+
// Only add tracing if provided by origintunneld
388+
if tracePropagation != "" {
389+
metadata = append(metadata, quicpogs.Metadata{
390+
Key: tracing.CanonicalCloudflaredTracingHeader,
391+
Val: tracePropagation,
392+
})
389393
}
390394
s.connectResponseSent = true
391-
return s.WriteConnectResponseData(nil, metadata)
395+
return s.WriteConnectResponseData(nil, metadata...)
392396
}
393397

394398
// httpResponseAdapter translates responses written by the HTTP Proxy into ones that can be used in QUIC.

0 commit comments

Comments
 (0)