-
Notifications
You must be signed in to change notification settings - Fork 7
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
Adds CORS possibility to nginx #14
base: master
Are you sure you want to change the base?
Conversation
Hi Peter, thanks for the PR, I think it makes sense to add this! I would however just use the existing variable |
Ah yes, I see, that does make more sense. I've updated the PR. |
I'm sorry, I was confused. The In case of Mutalyzer, non of the API responses are personalized (there is no authentication of any kind), so I would say it is safe (and easiest) to always set it to In other words, if we want to enable CORS with the Mutalyzer JSON API, I think it's best to just include this header with a non-configurable value of |
Sorry for the delay in replying. Ultimately it's up to you, but I wouldn't recommend forcing the CORS header to be *. It could be alright for a default, but I was looking in to deploying the API and using it alongside another piece of software and for that I would want to be able to configure the headers differently for development and production servers at least. |
Well, the point of the same-origin policy is to not give third parties access to resources on the user's behalf (i.e., using it's cookies, HTTP auth, etc). This is irrelevant for resources that behave the same for all users (i.e., don't have any form of sessions). For those kind of resources, the This applies to the Mutalyzer JSON webservice. It has no state, no user sessions. The CORS headers are specific for the resource (path), so even if you host other resources on the same domain which do have user sessions, this should not be an issue. One reason I can see to not implement this is the possibility for Mutalyzer to get sessions in the future. During development of such a feature, one could forget to change the Regardless, I think the PR makes sense and could definitely be useful to people. I'm not the Mutalyzer maintainer anymore, so I'll leave it at that ;) |
defaults to * for vagrant and ansible_host otherwise