-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add CORS headers to endpoint responses #168
Conversation
Wercker failed, but not because of changes in this PR... builds and runs successfully
|
I'm now away for a few days, but feel free to merge ahead of 2.8 as this has no config changes. I'm almost ready with new ansible stack to deploy all. |
I'm rebuilding now, I tried to move us to Werckers docker based builds but it failed. |
Is there not a way to modify the router at an early stage to always include the cors headers? |
I could also add it to Varnish as well |
As far as I can see from the docs, no. The best (?) way to do this is to have a hierarchal routing system and be able to apply middleware and other options to subtrees. Gorilla's mux doesn't seem to do this. Others might. If not it'd be an interesting exercise to build one. |
I've run this by @clone1018 on IRC, going to add this Will probably actually combine the two...
Slightly neater we think, though still open for improvement: 01:37:53 Yeah it's better Does this trigger any better ideas @connor4312 |
I have taken from this and created the release-2.9.1 PR #170 Any thoughts? |
It seems like a mildly hackish way to go about it, but it works. Really the "solution" would be a fancier routing system, which we don't necessarily need (at this point) |
This adds CORS headers to all endpoint responses, resolving #167