Kong Cors Plugin - unable to add multiple url in the origins config
Is there an existing issue for this?
- [X] I have searched the existing issues
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
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?
Expected Behavior
I'm expecting to be able to allow multiple URL with cors plugin
Steps To Reproduce
- Create the cors plugin in yaml format
- add 2 or more hostname in the origins config
- check the header in the Response headers
Anything else?
No response
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
I have istalled kong KIC via helm chart and the latest version seems 2.42.0 with 3.7.0 version
Hi @tao12345666333 , I'm not familiar with KIC. Do you know how to upgrade Kong in KIC to version 3.8, or when it will be upgraded to 3.8?
@carmine-ianniello-deltatre you can try simply giving "*" for origin, if security is not an issue here
@Water-Melon You can just update the values.yaml and set gateway.image.tags to "3.8" when you install KIC by kong/ingress charts.
Hi @tao12345666333 , I'm not familiar with KIC. Do you know how to upgrade Kong in KIC to version 3.8, or when it will be upgraded to 3.8?
Please follow the upgrade documentation:
https://docs.konghq.com/kubernetes-ingress-controller/latest/upgrade/gateway/
Kong gateway 3.8 can be used with KIC.