Fix CORS plugin configuration for API7 Enterprise
All checks were successful
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 2m22s
Build and Deploy / build-api (push) Successful in 4m6s
Build and Deploy / build-web (push) Successful in 4m33s

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 <noreply@anthropic.com>
This commit is contained in:
d.viti
2025-10-08 18:58:09 +02:00
parent 80ffa5e4fd
commit 8be1f85718

View File

@@ -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 }}