1
0
Fork 0

Fix entry point redirect behavior

This commit is contained in:
Ludovic Fernandez 2020-03-18 15:48:04 +01:00 committed by GitHub
parent 63d7ed74f1
commit 44221fba49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 184 additions and 38 deletions

View file

@ -1,6 +1,7 @@
package traefik
import (
"context"
"encoding/json"
"flag"
"io/ioutil"
@ -196,8 +197,30 @@ func Test_createConfiguration(t *testing.T) {
HTTP: static.HTTPConfig{
Redirections: &static.Redirections{
EntryPoint: &static.RedirectEntryPoint{
To: "websecure",
Scheme: "https",
To: "websecure",
Scheme: "https",
Permanent: true,
},
},
},
},
"websecure": {
Address: ":443",
},
},
},
}, {
desc: "redirection_port.json",
staticCfg: static.Configuration{
EntryPoints: map[string]*static.EntryPoint{
"web": {
Address: ":80",
HTTP: static.HTTPConfig{
Redirections: &static.Redirections{
EntryPoint: &static.RedirectEntryPoint{
To: ":443",
Scheme: "https",
Permanent: true,
},
},
},
@ -217,7 +240,7 @@ func Test_createConfiguration(t *testing.T) {
provider := Provider{staticCfg: test.staticCfg}
cfg := provider.createConfiguration()
cfg := provider.createConfiguration(context.Background())
filename := filepath.Join("fixtures", test.desc)