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

Consider cors middleware #15

Open
grabbou opened this issue Jun 23, 2015 · 4 comments
Open

Consider cors middleware #15

grabbou opened this issue Jun 23, 2015 · 4 comments

Comments

@grabbou
Copy link

grabbou commented Jun 23, 2015

Would be handy to have it out-of-the-box with api-defaults config. What you think?

@venantius
Copy link

This issue is now a few years old and it seems to me the space has continued to move in this direction. If your API isn't being served from the same domain, CORS middleware is now a requirement for production deployment. I know there are existing solutions out there for CORS middleware but I think having a solution in Ring would still be a good idea (and candidly, I always feel safer using middleware from ring over a third party). @weavejester, thoughts?

@weavejester
Copy link
Member

I don't think that would be a bad idea. Support for it is probably more stable now than it was. Of course, Ring-Defaults just provides defaults for existing Ring libraries, so first we'd need to build some appropriate middleware - either in Ring-Headers or a new Ring-CORS library. I'm leaning toward the latter.

@venantius
Copy link

I would suggest a merge of https://github.com/r0man/ring-cors. It's what I've used in the past -
it has a sane interface and covers the basics. Your call on where it should ultimately sit. Personally, I think since it's basically just string manipulation and has no external dependencies the bloat is small enough that it doesn't belong in a standalone lib (I was originally thinking ring-core).

@weavejester
Copy link
Member

Unfortunately, licensing differences make ring-cors unusable for this purpose. It shouldn't be too hard to recreate something like it from scratch, however.

The resulting library definitely shouldn't be in Ring-Core. Ring-Headers is a possibility.

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

No branches or pull requests

3 participants