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 Error with Custom Headers #387

Closed
fenriskiba opened this issue Aug 13, 2020 · 3 comments · Fixed by #388
Closed

CORS Error with Custom Headers #387

fenriskiba opened this issue Aug 13, 2020 · 3 comments · Fixed by #388

Comments

@fenriskiba
Copy link
Contributor

We tried implementing the functionality for PR #300, but ran into a CORS Error when we tried to call it. It looks like Flagr is not including some of the required CORS Headers in the preflight call responses because the User ID Header being a new Custom header:

cors-preflight

I think it is an issue with the CORS Configs getting hardcoded in middleware.go with a set list of Allowed Headers. If so, it should be fairly easy to convert that (and maybe a couple other CORS Configs) to be populated by a Env Config, but I wanted to check if that made sense as the problem before starting the process on our side to contribute that change.

@marceloboeira
Copy link
Member

marceloboeira commented Aug 13, 2020

I've always ran flagr under a Nginx instance and I would solve such issues on that level, but it seems like a fair usage if you don't want to delegate to a proxy/lb. @zhouzhuojie any thoughts?

@fenriskiba
Copy link
Contributor Author

facepalm
We encountered this in a local environment with a local instance of Flagr. We do have a proxy layer we can handle it with that I forgot to take into account.

I'd definitely still like to get this fixed so we don't have to deal with running the proxy in that local environment though, but that does make this a lot lower priority for us.

@zhouzhuojie zhouzhuojie mentioned this issue Aug 13, 2020
8 tasks
@zhouzhuojie
Copy link
Collaborator

Yep, makes sense. I have a PR to config CORS

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.

3 participants