From 8be1f857186b9f91713e60d288efaf8afe5ae909 Mon Sep 17 00:00:00 2001 From: "d.viti" Date: Wed, 8 Oct 2025 18:58:09 +0200 Subject: [PATCH] Fix CORS plugin configuration for API7 Enterprise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed CORS plugin array values to comma-separated strings: - allow_origins: from JSON array to comma-separated string - allow_methods: from JSON array to comma-separated string - allow_headers: from JSON array to comma-separated string - expose_headers: from JSON array to comma-separated string API7 Enterprise expects string values with comma-separated items, not JSON arrays. This fixes the validation error: "Invalid type. Expected: string, given: array" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../templates/configmap-adc.yaml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/helm/api7ee-demo-k8s/templates/configmap-adc.yaml b/helm/api7ee-demo-k8s/templates/configmap-adc.yaml index c7588ef..29ec7ba 100644 --- a/helm/api7ee-demo-k8s/templates/configmap-adc.yaml +++ b/helm/api7ee-demo-k8s/templates/configmap-adc.yaml @@ -38,10 +38,10 @@ data: {{- end }} {{- if .Values.api7.plugins.cors.enabled }} cors: - allow_origins: {{ .Values.api7.plugins.cors.allowOrigins | toJson }} - allow_methods: {{ .Values.api7.plugins.cors.allowMethods | toJson }} - allow_headers: {{ .Values.api7.plugins.cors.allowHeaders | toJson }} - expose_headers: {{ .Values.api7.plugins.cors.exposeHeaders | toJson }} + allow_origins: {{ .Values.api7.plugins.cors.allowOrigins | join "," | quote }} + allow_methods: {{ .Values.api7.plugins.cors.allowMethods | join "," | quote }} + allow_headers: {{ .Values.api7.plugins.cors.allowHeaders | join "," | quote }} + expose_headers: {{ .Values.api7.plugins.cors.exposeHeaders | join "," | quote }} max_age: {{ .Values.api7.plugins.cors.maxAge }} allow_credential: {{ .Values.api7.plugins.cors.allowCredentials }} {{- end }} @@ -72,10 +72,10 @@ data: {{- end }} {{- if .Values.api7.plugins.cors.enabled }} cors: - allow_origins: {{ .Values.api7.plugins.cors.allowOrigins | toJson }} - allow_methods: {{ .Values.api7.plugins.cors.allowMethods | toJson }} - allow_headers: {{ .Values.api7.plugins.cors.allowHeaders | toJson }} - expose_headers: {{ .Values.api7.plugins.cors.exposeHeaders | toJson }} + allow_origins: {{ .Values.api7.plugins.cors.allowOrigins | join "," | quote }} + allow_methods: {{ .Values.api7.plugins.cors.allowMethods | join "," | quote }} + allow_headers: {{ .Values.api7.plugins.cors.allowHeaders | join "," | quote }} + expose_headers: {{ .Values.api7.plugins.cors.exposeHeaders | join "," | quote }} max_age: {{ .Values.api7.plugins.cors.maxAge }} allow_credential: {{ .Values.api7.plugins.cors.allowCredentials }} {{- end }} @@ -100,10 +100,10 @@ data: {{- end }} {{- if .Values.api7.plugins.cors.enabled }} cors: - allow_origins: {{ .Values.api7.plugins.cors.allowOrigins | toJson }} - allow_methods: {{ .Values.api7.plugins.cors.allowMethods | toJson }} - allow_headers: {{ .Values.api7.plugins.cors.allowHeaders | toJson }} - expose_headers: {{ .Values.api7.plugins.cors.exposeHeaders | toJson }} + allow_origins: {{ .Values.api7.plugins.cors.allowOrigins | join "," | quote }} + allow_methods: {{ .Values.api7.plugins.cors.allowMethods | join "," | quote }} + allow_headers: {{ .Values.api7.plugins.cors.allowHeaders | join "," | quote }} + expose_headers: {{ .Values.api7.plugins.cors.exposeHeaders | join "," | quote }} max_age: {{ .Values.api7.plugins.cors.maxAge }} allow_credential: {{ .Values.api7.plugins.cors.allowCredentials }} {{- end }}