TUN-4889: Add back appendtagheaders function

TUN-4701 accidentally removed adding tagheaders. This commit adds it
back.
This commit is contained in:
Sudarsan Reddy
2021-08-23 16:04:09 +01:00
parent 3ef3e7a99a
commit b6c85401a5
4 changed files with 5 additions and 3 deletions

View File

@@ -63,6 +63,7 @@ func (p *Proxy) ProxyHTTP(
cfRay := connection.FindCfRayHeader(req)
lbProbe := connection.IsLBProbeRequest(req)
p.appendTagHeaders(req)
rule, ruleNum := p.ingressRules.FindMatchingRule(req.Host, req.URL.Path)
logFields := logFields{

View File

@@ -30,7 +30,7 @@ import (
)
var (
testTags = []tunnelpogs.Tag(nil)
testTags = []tunnelpogs.Tag{tunnelpogs.Tag{Name: "Name", Value: "value"}}
unusedWarpRoutingService = (*ingress.WarpRoutingService)(nil)
)
@@ -150,6 +150,9 @@ func testProxyHTTP(proxy connection.OriginProxy) func(t *testing.T) {
err = proxy.ProxyHTTP(responseWriter, req, false)
require.NoError(t, err)
for _, tag := range testTags {
assert.Equal(t, tag.Value, req.Header.Get(TagHeaderNamePrefix+tag.Name))
}
assert.Equal(t, http.StatusOK, responseWriter.Code)
}