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

Allow disabling setting CORS headers #3918

Closed
brancz opened this issue Mar 11, 2021 · 2 comments · Fixed by #3919
Closed

Allow disabling setting CORS headers #3918

brancz opened this issue Mar 11, 2021 · 2 comments · Fixed by #3919

Comments

@brancz
Copy link
Member

brancz commented Mar 11, 2021

Is your proposal related to a problem?

We have a proxy in front of Thanos that manages things like authentication etc. which has it's own CORS policy, but since Thanos also sets CORS headers they end up being set multiple times which ends up conflicting.

Describe the solution you'd like

Add a flag --disable-cors. That causes no CORS headers to be set.

Describe alternatives you've considered

Can't really think of another way, except maybe allowing more specific CORS configuration, but that doesn't appear to have been a problem for anyone else so far.

@thanos-io/thanos-maintainers

@onprem
Copy link
Member

onprem commented Mar 11, 2021

I think we can use the proxy in front of Thanos to override these headers, can't we?

But having a flag sounds doable as well.

@brancz
Copy link
Member Author

brancz commented Mar 11, 2021

Not really, as headers are written first, so what happens is

  1. our proxy sets CORS headers
  2. thanos sets CORS headers (and "wins" the conflict)
  3. thanos returns body

Once a body is written it is impossible to write headers, so there's really no other option.

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

Successfully merging a pull request may close this issue.

2 participants