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

Feature request: Open up CORS by default #493

Open
royduin opened this issue Jun 6, 2020 · 0 comments
Open

Feature request: Open up CORS by default #493

royduin opened this issue Jun 6, 2020 · 0 comments
Labels
Feature request Feature Needs review Tickets that need review

Comments

@royduin
Copy link

royduin commented Jun 6, 2020

I've added

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: *');
header('Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization,X-ReCaptcha,Store');

if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
    http_response_code(200);
    exit;
}

At the beginnen of the server.php which seems to do the trick. Handling this in the Nginx config is also possible but then we've to catch the OPTIONS request there for the CORS preflight requests.

@royduin royduin added Feature request Feature Needs review Tickets that need review labels Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Feature Needs review Tickets that need review
Projects
None yet
Development

No branches or pull requests

1 participant