forked from Ivasoft/traefik
fix: default passHostHeader for file provider.
This commit is contained in:
committed by
Traefiker Bot
parent
230cd28ac9
commit
48f11900d3
@@ -13,7 +13,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 TestDefaultRule(t *testing.T) {
|
||||
testCases := []struct {
|
||||
@@ -64,7 +65,7 @@ func TestDefaultRule(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -113,7 +114,7 @@ func TestDefaultRule(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -164,7 +165,7 @@ func TestDefaultRule(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -208,7 +209,7 @@ func TestDefaultRule(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -252,7 +253,7 @@ func TestDefaultRule(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -301,7 +302,7 @@ func TestDefaultRule(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -384,7 +385,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -452,7 +453,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
"Test2": {
|
||||
@@ -462,7 +463,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -531,7 +532,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -581,7 +582,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -633,7 +634,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -677,7 +678,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -734,7 +735,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -781,7 +782,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
@@ -791,7 +792,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -842,7 +843,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1052,7 +1053,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1101,7 +1102,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1193,7 +1194,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1266,7 +1267,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1361,7 +1362,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.3:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1429,7 +1430,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1519,7 +1520,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.3:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1592,7 +1593,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1655,7 +1656,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
"Test2": {
|
||||
@@ -1665,7 +1666,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1715,7 +1716,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1766,7 +1767,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "h2c://127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1812,7 +1813,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
"Service2": {
|
||||
@@ -1822,7 +1823,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:8080",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -2037,7 +2038,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -2098,7 +2099,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.1:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -2348,7 +2349,7 @@ func Test_buildConfiguration(t *testing.T) {
|
||||
URL: "http://127.0.0.2:80",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
PassHostHeader: Bool(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user