Fix partial declaration of authentication.

This commit is contained in:
Ludovic Fernandez
2018-11-22 16:52:03 +01:00
committed by Traefiker Bot
parent ef6c1fac4b
commit 479ee9af49
2 changed files with 9 additions and 0 deletions

View File

@@ -109,6 +109,8 @@ func GetAuth(labels map[string]string) *types.Auth {
auth.Digest = getAuthDigest(labels)
} else if HasPrefix(labels, TraefikFrontendAuthForward) {
auth.Forward = getAuthForward(labels)
} else {
return nil
}
return auth

View File

@@ -732,6 +732,13 @@ func TestGetAuth(t *testing.T) {
labels: map[string]string{},
expected: nil,
},
{
desc: "should return nil when no real auth",
labels: map[string]string{
TraefikFrontendAuthHeaderField: "myHeaderField",
},
expected: nil,
},
{
desc: "should return a basic auth",
labels: map[string]string{