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 solution #19

Open
bkrajendra opened this issue Feb 3, 2020 · 1 comment
Open

CORS solution #19

bkrajendra opened this issue Feb 3, 2020 · 1 comment

Comments

@bkrajendra
Copy link

bkrajendra commented Feb 3, 2020

For me plugin only works if I add :

header("Access-Control-Allow-Origin: *");

in BaseApiController.php


    public function __construct($theme = null)
    {
    	header("Access-Control-Allow-Origin: *");
        $this->initializeQueryBuilder();

        parent::__construct($theme);
    }

I am not using any cors plugin.
I tested this multiple time and even verified with https://www.test-cors.org/
In Fact none of the CORS plugin on marketplace worked for me.

I suggest to test this and make it part of plugin if you feel its helping.
Note: Im testing this with my Angular 8 frontend web-app.

@bkrajendra
Copy link
Author

@caothang53
any update on this? Plugin still does not work after latest update.
Same CORS error throw up.
adding above line makes it working.
It will be better if this is integrated with plugin.

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

1 participant