Skip to content

Commit a414dcb

Browse files
committed
Remove append from baseHeaders
1 parent 7d7c28f commit a414dcb

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

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

+18-12
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const (
2020
rootPath = "/"
2121
)
2222

23-
// baseHeaders contains the constant headers set in each server block
24-
var baseHeaders = []http.Header{
23+
// httpBaseHeaders contains the constant headers set in each HTTP server block
24+
var httpBaseHeaders = []http.Header{
2525
{
2626
Name: "Host",
2727
Value: "$gw_api_compliant_host",
@@ -30,25 +30,31 @@ var baseHeaders = []http.Header{
3030
Name: "X-Forwarded-For",
3131
Value: "$proxy_add_x_forwarded_for",
3232
},
33-
}
34-
35-
// httpBaseHeaders contains the constant headers set in each HTTP server block
36-
var httpBaseHeaders = append(baseHeaders,
37-
http.Header{
33+
{
3834
Name: "Upgrade",
3935
Value: "$http_upgrade",
4036
},
41-
http.Header{
37+
{
4238
Name: "Connection",
4339
Value: "$connection_upgrade",
44-
})
40+
},
41+
}
4542

4643
// grpcBaseHeaders contains the constant headers set in each gRPC server block
47-
var grpcBaseHeaders = append(baseHeaders,
48-
http.Header{
44+
var grpcBaseHeaders = []http.Header{
45+
{
46+
Name: "Host",
47+
Value: "$gw_api_compliant_host",
48+
},
49+
{
50+
Name: "X-Forwarded-For",
51+
Value: "$proxy_add_x_forwarded_for",
52+
},
53+
{
4954
Name: "Authority",
5055
Value: "$gw_api_compliant_host",
51-
})
56+
},
57+
}
5258

5359
func executeServers(conf dataplane.Configuration) []executeResult {
5460
servers, httpMatchPairs := createServers(conf.HTTPServers, conf.SSLServers)

0 commit comments

Comments
 (0)