feat(kv): add error pages configuration.
This commit is contained in:
parent
cfa1f47226
commit
51390aa874
4 changed files with 98 additions and 0 deletions
|
@ -81,6 +81,18 @@ func withPair(key string, value string) func(map[string]string) {
|
|||
}
|
||||
}
|
||||
|
||||
func withErrorPage(name string, backend, query, status string) func(map[string]string) {
|
||||
return func(pairs map[string]string) {
|
||||
if len(name) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
withPair(pathFrontendErrorPages+name+pathFrontendErrorPagesBackend, backend)(pairs)
|
||||
withPair(pathFrontendErrorPages+name+pathFrontendErrorPagesQuery, query)(pairs)
|
||||
withPair(pathFrontendErrorPages+name+pathFrontendErrorPagesStatus, status)(pairs)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFiller(t *testing.T) {
|
||||
expected := []*store.KVPair{
|
||||
{Key: "traefik/backends/backend.with.dot.too", Value: []byte("")},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue