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 middleware #324

Merged
merged 2 commits into from
Dec 7, 2022
Merged

Conversation

jonasKjellerup
Copy link
Contributor

@jonasKjellerup jonasKjellerup commented Nov 29, 2022

This PR adds a Django middleware that handles CORS requests. This allows CORS compliant clients (primarily web browsers) to access exposed API endpoints. The PR is primarily aimed at granting the access necessary for fappen to work.

  • Handles CORS preflight requests
    • Allows all normal headers (permissions set to *)
    • Allows methods: POST, GET, OPTIONS, DELETE
  • Sets allowed origins to:
    • the request origin if given
    • * if origin is unknown
  • Allows requests to contain credentials (cookies)

Copy link
Member

@falkecarlsen falkecarlsen left a comment

Choose a reason for hiding this comment

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

:shipit: fritfit

@falkecarlsen falkecarlsen merged commit f9e896d into f-klubben:next Dec 7, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants