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

server: fix api CORS preflight error #6544

Closed
c608345 opened this issue Apr 8, 2024 · 2 comments
Closed

server: fix api CORS preflight error #6544

c608345 opened this issue Apr 8, 2024 · 2 comments

Comments

@c608345
Copy link

c608345 commented Apr 8, 2024

Add

    // If it's browser preflight, skip validation
    if (req.method == "OPTIONS") {
        return true;
    }

to server.cpp middleware_validate_api_key will make API CORS works.

@phymbert
Copy link
Collaborator

Please submit a PR :)

@github-actions github-actions bot added the stale label May 14, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants