Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
carmine-ianniello-deltatre opened this issue Nov 25, 2024 · 4 comments
Open
1 task done
Labels
area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller area/kubernetes Issues where Kong is running on top of Kubernetes

Comments

@carmine-ianniello-deltatre
Copy link

carmine-ianniello-deltatre commented Nov 25, 2024

Is there an existing issue for this?

  • 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

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

  • 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

@xianghai2 xianghai2 added area/kubernetes Issues where Kong is running on top of Kubernetes area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller labels Nov 26, 2024
@xianghai2
Copy link

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
Copy link
Author

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

@Water-Melon
Copy link
Contributor

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?

@KDTEC
Copy link

KDTEC commented Dec 26, 2024

@carmine-ianniello-deltatre you can try simply giving "*" for origin, if security is not an issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller area/kubernetes Issues where Kong is running on top of Kubernetes
Projects
None yet
Development

No branches or pull requests

4 participants