Skip to content

Commit 6462c78

Browse files
ivanmatmatioktalz
authored andcommitted
BUG: fix missing cors-enable annotation treatment
1 parent 5c5457e commit 6462c78

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

controller/annotations/annotations.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ func Frontend(i *store.Ingress, r *rules.Rules, m maps.MapFiles) []Annotation {
9090
reqAuth.NewAnnotation("auth-secret"),
9191
reqCapture.NewAnnotation("request-capture"),
9292
reqCapture.NewAnnotation("request-capture-len"),
93+
// always put cors-enable annotation before any oth
94+
resSetCORS.NewAnnotation("cors-enable"),
9395
resSetCORS.NewAnnotation("cors-allow-origin"),
9496
resSetCORS.NewAnnotation("cors-allow-method"),
9597
resSetCORS.NewAnnotation("cors-allow-headers"),

controller/annotations/ingress/resSetCORS.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/haproxytech/kubernetes-ingress/controller/utils"
1111
)
1212

13-
const corsVarName = "cors-origin"
13+
const corsVarName = "cors_origin"
1414

1515
type ResSetCORS struct {
1616
rules *rules.Rules

0 commit comments

Comments
 (0)