From 6462c784c163a91a553652695218c3abceb4f06e Mon Sep 17 00:00:00 2001 From: Ivan Matmati Date: Mon, 11 Apr 2022 11:03:55 +0200 Subject: [PATCH] BUG: fix missing cors-enable annotation treatment --- controller/annotations/annotations.go | 2 ++ controller/annotations/ingress/resSetCORS.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/controller/annotations/annotations.go b/controller/annotations/annotations.go index 6feae91c..9ac34e2b 100644 --- a/controller/annotations/annotations.go +++ b/controller/annotations/annotations.go @@ -90,6 +90,8 @@ func Frontend(i *store.Ingress, r *rules.Rules, m maps.MapFiles) []Annotation { reqAuth.NewAnnotation("auth-secret"), reqCapture.NewAnnotation("request-capture"), reqCapture.NewAnnotation("request-capture-len"), + // always put cors-enable annotation before any oth + resSetCORS.NewAnnotation("cors-enable"), resSetCORS.NewAnnotation("cors-allow-origin"), resSetCORS.NewAnnotation("cors-allow-method"), resSetCORS.NewAnnotation("cors-allow-headers"), diff --git a/controller/annotations/ingress/resSetCORS.go b/controller/annotations/ingress/resSetCORS.go index 085e6fec..40ad865f 100644 --- a/controller/annotations/ingress/resSetCORS.go +++ b/controller/annotations/ingress/resSetCORS.go @@ -10,7 +10,7 @@ import ( "github.com/haproxytech/kubernetes-ingress/controller/utils" ) -const corsVarName = "cors-origin" +const corsVarName = "cors_origin" type ResSetCORS struct { rules *rules.Rules