Custom frontend name for test helper

This commit is contained in:
Ludovic Fernandez 2018-06-06 15:20:03 +02:00 committed by Traefiker Bot
parent 2c47691cf1
commit e9c63f3988
2 changed files with 25 additions and 0 deletions

View file

@ -180,11 +180,22 @@ func frontend(backend string, opts ...func(*types.Frontend)) func(*types.Fronten
for _, opt := range opts {
opt(f)
}
// related the function frontendName
name := f.Backend
f.Backend = backend
if len(name) > 0 {
return name
}
return backend
}
}
func frontendName(name string) func(*types.Frontend) {
return func(f *types.Frontend) {
// store temporary the frontend name into the backend name
f.Backend = name
}
}
func passHostHeader() func(*types.Frontend) {
return func(f *types.Frontend) {
f.PassHostHeader = true