Skip to content

Commit aff0520

Browse files
committed
BUG: reenable cors-allow-credentials annotation
1 parent 597e9f9 commit aff0520

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

controller/annotations/annotations.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func Frontend(i *store.Ingress, r *rules.Rules, m maps.MapFiles) []Annotation {
9696
resSetCORS.NewAnnotation("cors-allow-methods"),
9797
resSetCORS.NewAnnotation("cors-allow-headers"),
9898
resSetCORS.NewAnnotation("cors-max-age"),
99+
resSetCORS.NewAnnotation("cors-allow-credentials"),
99100
}
100101
}
101102

controller/annotations/ingress/resSetCORS.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ func (a ResSetCORSAnn) Process(k store.K8s, annotations ...map[string]string) (e
130130
Response: true,
131131
CondTest: a.parent.acl,
132132
})
133+
case "cors-allow-credentials":
134+
if a.parent.acl == "" {
135+
return
136+
}
137+
a.parent.rules.Add(&rules.SetHdr{
138+
HdrName: "Access-Control-Allow-Credentials",
139+
HdrFormat: "\"true\"",
140+
Response: true,
141+
CondTest: a.parent.acl,
142+
})
133143
default:
134144
err = fmt.Errorf("unknown cors annotation '%s'", a.name)
135145
}

0 commit comments

Comments
 (0)