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 and REST #3011

Closed
subdee opened this issue Apr 7, 2014 · 1 comment
Closed

CORS and REST #3011

subdee opened this issue Apr 7, 2014 · 1 comment
Milestone

Comments

@subdee
Copy link
Contributor

subdee commented Apr 7, 2014

As metioned in #303 , CORS might sometimes need to be used for cross-domain AJAX calls. Some libraries like Angular require certain headers to be present for non-GET and non-POST requests otherwise they error out. Some headers are outlined here: https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS#The_HTTP_response_headers

My proposal would be to have a CORS flag that if enabled, it will create and send those headers along. I have currently implemented this in the beforeAction of my controller but I can create a Pull request for review and suggestions, if it's considered.

@qiangxue qiangxue added this to the 2.1 milestone Apr 16, 2014
@pgaultier
Copy link
Contributor

This feature has been added with yii\filters\Cors

@cebe cebe modified the milestones: 2.0 RC, 2.1 Jul 21, 2014
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

4 participants