Skip to content

Commit

Permalink
BUG: reenable cors-allow-credentials annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmatmati authored and oktalz committed Apr 22, 2022
1 parent fc82912 commit 9464b03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions controller/annotations/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func Frontend(i *store.Ingress, r *rules.Rules, m maps.MapFiles) []Annotation {
resSetCORS.NewAnnotation("cors-allow-methods"),
resSetCORS.NewAnnotation("cors-allow-headers"),
resSetCORS.NewAnnotation("cors-max-age"),
resSetCORS.NewAnnotation("cors-allow-credentials"),
}
}

Expand Down
10 changes: 10 additions & 0 deletions controller/annotations/ingress/resSetCORS.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ func (a ResSetCORSAnn) Process(k store.K8s, annotations ...map[string]string) (e
Response: true,
CondTest: a.parent.acl,
})
case "cors-allow-credentials":
if a.parent.acl == "" {
return
}
a.parent.rules.Add(&rules.SetHdr{
HdrName: "Access-Control-Allow-Credentials",
HdrFormat: "\"true\"",
Response: true,
CondTest: a.parent.acl,
})
default:
err = fmt.Errorf("unknown cors annotation '%s'", a.name)
}
Expand Down

0 comments on commit 9464b03

Please sign in to comment.