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 #160

Closed
navinSing opened this issue Jan 13, 2016 · 13 comments
Closed

cors headers #160

navinSing opened this issue Jan 13, 2016 · 13 comments
Labels
kind/enhancement a new or improved feature. priority/P2 need to be fixed in the future status/5-frozen-due-to-age

Comments

@navinSing
Copy link

how to add cors headers similar to haproxy's rspadd .. etc

This would be much needed and common feature.

Need a quick fix to add (cors) headers to outgoing messages .. for now.

for ex: in haproxy's backend we add ,..
rspadd Access-Control-Allow-Origin:
rspadd Access-Control-Headers:\

Restrictions on frontends can be added later.

@emilevauge emilevauge added the kind/enhancement a new or improved feature. label Jan 14, 2016
@emilevauge
Copy link
Member

Hi @navinSing, this is certainly an interesting feature. As Traefik uses negroni to manage network middlewares, we could use https://github.com/rs/cors to make it work.
This is not in my top priority for now, would you be interested to make a PR on that?

@navinSing
Copy link
Author

Hi @emilevauge
can you please give an example to make it work .. rs/cors , or a possible way to intergrate the same for now, as this is blocker for me(any example for the workaround will be helpful); else would have to switch to some other frameworks.

@navinSing
Copy link
Author

sorry still not sure how to do it .. like rspadd Access-Control-Allow-Origin:\ etc ..

in both frontends and backends

@emilevauge
Copy link
Member

Hi @navinSing, as I said you can't do it right now, some dev is needed to make it work.

@navinSing
Copy link
Author

any rough timelines..
don't have much hands on with golang ..

@sandstrom
Copy link

Somewhat related, being able to modify (add/edit/remove) headers in the responses returned from backends would be nice (used for other things too). There is already a broader issue on this open: #30

Just trying to help with some issue-gardening. 🌳 🍃 🌷

@mathieu-pousse
Copy link

@navinSing practically, it is up to your backend to add the CORS headers to the response and to tune the security more than to the reverse proxy.

@michaelkrog
Copy link

michaelkrog commented Sep 22, 2016

@navinSing There are certainly situations where CORS from the backend is impractical.

We are in the process of dividing our backend from a monolith to many microservices. Together they expose one API. We do not want each of the services to decide the CORS header. We want one unified CORS header for the whole API – and that would fit nicely in our edge proxy.

Edit
Also, some of our services will be used by other public API's and they would need other CORS headers, when exposed there.

@zytek
Copy link

zytek commented Dec 12, 2016

We have >100 services under one API and would also prefer to manage headers on the loadbalancer itself.

@athoune
Copy link

athoune commented Feb 12, 2017

there is a lot of security related headers, not just CORS : https://blog.appcanary.com/2017/http-security-headers.html

@andrewmclagan
Copy link

Any movement on this issue.?

I feel allot of people use traefik as an API gateway, having forward proxy features such as CORS is such a huge win in these cases. Draining the need for each service to manage it independently.

@ldez
Copy link
Contributor

ldez commented Apr 29, 2017

You can track those PR #1292 #1236

@ldez ldez added the priority/P2 need to be fixed in the future label May 30, 2017
@ldez
Copy link
Contributor

ldez commented Jun 13, 2017

Closed by #1236.

@ldez ldez closed this as completed Jun 13, 2017
@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/enhancement a new or improved feature. priority/P2 need to be fixed in the future status/5-frozen-due-to-age
Projects
None yet
Development

No branches or pull requests

10 participants