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

Added CORS support to API. #691

Merged
merged 1 commit into from
Jun 22, 2020
Merged

Added CORS support to API. #691

merged 1 commit into from
Jun 22, 2020

Conversation

a-bali
Copy link
Contributor

@a-bali a-bali commented Jun 16, 2020

Could not make Gorilla's built-in CORS handler work therefore added a simple middleware function to set the required (very permissive) CORS headers and a blank reply to the preflight requests (OPTION).

Closes #675

sr.Use(middleware.apiKeyAuth)
sr.Use(middleware.basicAuth)
sr.Methods("OPTIONS")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why OPTIONS needs to be here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To handle the preflight requests.

@fguillot fguillot merged commit adbebd4 into miniflux:master Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add CORS support to API
2 participants