Kong / kong

🦍 The Cloud-Native API Gateway and AI Gateway.
https://konghq.com/install/
Apache License 2.0
39.38k stars 4.83k forks source link

Kong Cors Plugin - unable to add multiple url in the origins config #13919

Open carmine-ianniello-deltatre opened 4 days ago

carmine-ianniello-deltatre commented 4 days ago

Is there an existing issue for this?

Kong version ($ kong version)

KIC 3.1

Current Behavior

Hello,

I'm using Kong ingress controller 3.1 version with the Cors plugin configured as below. When I use it with a single origin in the config field, everything works as expected, as shown in the image below.

apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: kong-cors-custom
config:
  origins:
  - first-url.com
  - second-url.com
  credentials: true
  max_age: 3600
  preflight_continue: false
plugin: cors

image

But when I try to add another origin, the Allow-Control-Allow-Origins header disappears, not allowing neither the first URL.

From my understanding the plugin should be able to add multiple origins URLs, is that right?

image

Expected Behavior

I'm expecting to be able to allow multiple URL with cors plugin

Steps To Reproduce

Anything else?

No response

xianghai2 commented 3 days ago

Recommend to use Kong version 3.8.

And check if it's an existing issue: https://docs.konghq.com/hub/kong-inc/cors/changelog/

CC: @randmonkey

carmine-ianniello-deltatre commented 3 days ago

I have istalled kong KIC via helm chart and the latest version seems 2.42.0 with 3.7.0 version