Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Attaching CORS filter by default to RestGroup #44

Open
tunecino opened this issue Aug 27, 2019 · 5 comments
Open

Attaching CORS filter by default to RestGroup #44

tunecino opened this issue Aug 27, 2019 · 5 comments
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement Enhancement

Comments

@tunecino
Copy link

See yiisoft/yii2#11086 for details.

This is an issue that has been fixed in Yii 2.0 by suggesting a manual fix of order issue within docs because it was a BC.

I think it is the moment to make it right and add CORS by default here as the majority may need their REST apps to be consumed by browsers. Without the Access-Control-Allow-Origin even thrown errors will cause browser to trigger CORS preflight.

@samdark samdark added type:enhancement Enhancement status:ready for adoption Feel free to implement this issue. labels Aug 27, 2019
@samdark
Copy link
Member

samdark commented Aug 27, 2019

That is a good idea.

@rustamwin
Copy link
Member

I think, all filters should be implemented as middleware :)

@samdark
Copy link
Member

samdark commented Aug 27, 2019

@rustamwin is correct.

@samdark
Copy link
Member

samdark commented Sep 8, 2020

Instead of controller it should be added to https://github.com/yiisoft/yii-rest/blob/master/src/RestGroup.php.

@samdark samdark changed the title Attaching CORS filter by default to Yiisoft\Yii\Rest\Controller Attaching CORS filter by default to RestGroup Sep 8, 2020
@samdark
Copy link
Member

samdark commented Sep 8, 2020

There's currently no CORS implementation. See https://trello.com/c/650bV6jy/116-implement-cors-middleware

@samdark samdark added status:ready for adoption Feel free to implement this issue. and removed status:ready for adoption Feel free to implement this issue. labels Sep 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants