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

CORS headers duplicated if upstream sends CORS headers #2138

Closed
dobesv opened this issue Feb 24, 2018 · 0 comments · Fixed by #2140
Closed

CORS headers duplicated if upstream sends CORS headers #2138

dobesv opened this issue Feb 24, 2018 · 0 comments · Fixed by #2140

Comments

@dobesv
Copy link

dobesv commented Feb 24, 2018

NGINX Ingress controller version:

quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.10.2

Kubernetes version (use kubectl version):

Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T10:09:24Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.8", GitCommit:"2f73858c9e6ede659d6828fe5a1862a48034a0fd", GitTreeState:"clean", BuildDate:"2018-02-09T21:23:25Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration: kops

What happened:

I enabled cors on an ingress. The backend also sent CORS headers. The CORS headers were rejected by the client because the Origin header was incorrect.

What you expected to happen:

I would prefer if it enabling CORS would override / block any CORS headers sent by the upstream.

How to reproduce it (as minimally and precisely as possible):

Setup an HTTP server that sends CORS headers itself, then put it behind ingress-nginx with cors enabled. See whether the Access-Control-Allow-Origin header is sent twice and the cross-origin request fails as a result.

Anything else we need to know:

Probably just need to add a few nginx directives to block CORS headers from the upstream when they are being added by ingress-nginx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant