fix: default passHostHeader for file provider.
This commit is contained in:
parent
230cd28ac9
commit
48f11900d3
22 changed files with 193 additions and 161 deletions
|
@ -11,7 +11,8 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Int(v int) *int { return &v }
|
||||
func Int(v int) *int { return &v }
|
||||
func Bool(v bool) *bool { return &v }
|
||||
|
||||
func TestGetConfigurationAPIErrors(t *testing.T) {
|
||||
fakeClient := newFakeClient(true, marathon.Applications{})
|
||||
|
@ -64,7 +65,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
}},
|
||||
},
|
||||
},
|
||||
|
@ -118,7 +119,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
}},
|
||||
},
|
||||
},
|
||||
|
@ -164,7 +165,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
}},
|
||||
},
|
||||
},
|
||||
|
@ -211,7 +212,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:8081",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
}},
|
||||
},
|
||||
},
|
||||
|
@ -266,7 +267,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:8083",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
}},
|
||||
},
|
||||
},
|
||||
|
@ -308,7 +309,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
}},
|
||||
"bar": {LoadBalancer: &dynamic.ServersLoadBalancer{
|
||||
Servers: []dynamic.Server{
|
||||
|
@ -316,7 +317,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:8081",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
}},
|
||||
},
|
||||
},
|
||||
|
@ -354,7 +355,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:81",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -390,7 +391,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
}},
|
||||
},
|
||||
},
|
||||
|
@ -428,7 +429,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -459,7 +460,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -503,7 +504,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -537,7 +538,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -547,7 +548,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -639,7 +640,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
"app2": {
|
||||
|
@ -649,7 +650,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -696,7 +697,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
"app2": {
|
||||
|
@ -706,7 +707,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -744,7 +745,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
"app2": {
|
||||
|
@ -754,7 +755,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -802,7 +803,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -840,7 +841,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
"app2": {
|
||||
|
@ -850,7 +851,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -887,7 +888,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -925,7 +926,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "h2c://localhost:90",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -958,7 +959,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
|
@ -968,7 +969,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1133,7 +1134,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1171,7 +1172,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1208,7 +1209,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1417,7 +1418,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
URL: "http://localhost:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue