Skip to content

Commit e31fa4d

Browse files
committed
fix test
1 parent 86fc671 commit e31fa4d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

internal/mode/static/nginx/config/servers_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,6 +2723,11 @@ func TestGenerateProxySetHeaders(t *testing.T) {
27232723
},
27242724
},
27252725
},
2726+
{
2727+
msg: "no filter set",
2728+
expectedHeaders: httpBaseHeaders,
2729+
GRPC: false,
2730+
},
27262731
}
27272732

27282733
for _, tc := range tests {

internal/mode/static/state/dataplane/configuration.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,9 @@ func buildBaseHTTPConfig(g *graph.Graph) BaseHTTPConfig {
863863
}
864864

865865
if len(g.NginxProxy.Source.Spec.RewriteClientIP.TrustedAddresses) > 0 {
866-
trustedAddresses := convertTrustedAddresses(g.NginxProxy.Source.Spec.RewriteClientIP.TrustedAddresses)
867-
baseConfig.RewriteClientIPSettings.TrustedAddresses = trustedAddresses
866+
baseConfig.RewriteClientIPSettings.TrustedAddresses = convertTrustedAddresses(
867+
g.NginxProxy.Source.Spec.RewriteClientIP.TrustedAddresses,
868+
)
868869
}
869870

870871
if g.NginxProxy.Source.Spec.RewriteClientIP.SetIPRecursively != nil {

0 commit comments

Comments
 (0)