Skip to content

Commit b6c8540

Browse files
TUN-4889: Add back appendtagheaders function
TUN-4701 accidentally removed adding tagheaders. This commit adds it back.
1 parent 3ef3e7a commit b6c8540

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

connection/protocol.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ func (p Protocol) TLSSettings() *TLSSettings {
7676
ServerName: edgeH2TLSServerName,
7777
}
7878
case QUIC:
79-
fmt.Println("returning this?")
8079
return &TLSSettings{
8180
ServerName: edgeQUICServerName,
8281
NextProtos: []string{"argotunnel"},

connection/quic.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ func (q *QUICConnection) handleStream(stream quic.Stream) error {
106106
w := newHTTPResponseAdapter(stream)
107107
return q.httpProxy.ProxyHTTP(w, req, connectRequest.Type == quicpogs.ConnectionTypeWebsocket)
108108
case quicpogs.ConnectionTypeTCP:
109-
// TODO: This is a placeholder for testing completion. TUN-4865 will add proper TCP support.
110109
rwa := &streamReadWriteAcker{
111110
ReadWriter: stream,
112111
}

origin/proxy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func (p *Proxy) ProxyHTTP(
6363

6464
cfRay := connection.FindCfRayHeader(req)
6565
lbProbe := connection.IsLBProbeRequest(req)
66+
p.appendTagHeaders(req)
6667

6768
rule, ruleNum := p.ingressRules.FindMatchingRule(req.Host, req.URL.Path)
6869
logFields := logFields{

origin/proxy_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
)
3131

3232
var (
33-
testTags = []tunnelpogs.Tag(nil)
33+
testTags = []tunnelpogs.Tag{tunnelpogs.Tag{Name: "Name", Value: "value"}}
3434
unusedWarpRoutingService = (*ingress.WarpRoutingService)(nil)
3535
)
3636

@@ -150,6 +150,9 @@ func testProxyHTTP(proxy connection.OriginProxy) func(t *testing.T) {
150150

151151
err = proxy.ProxyHTTP(responseWriter, req, false)
152152
require.NoError(t, err)
153+
for _, tag := range testTags {
154+
assert.Equal(t, tag.Value, req.Header.Get(TagHeaderNamePrefix+tag.Name))
155+
}
153156

154157
assert.Equal(t, http.StatusOK, responseWriter.Code)
155158
}

0 commit comments

Comments
 (0)