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

feat: add cors support #72

Merged
merged 28 commits into from
Sep 9, 2023
Merged

feat: add cors support #72

merged 28 commits into from
Sep 9, 2023

Conversation

punit-kulal
Copy link
Contributor

@punit-kulal punit-kulal commented Aug 29, 2023

  • Support for CORS in Rest backend.
    • Support is added by setting appropriate response headers.
  • Support for the following new env:
    • SERVER_CORS_ENABLED
    • SERVER_CORS_ALLOWED_ORIGIN
    • SERVER_CORS_ALLOWED_METHODS
    • SERVER_CORS_ALLOWED_HEADERS
    • SERVER_CORS_ALLOW_CREDENTIALS
    • SERVER_CORS_PREFLIGHT_MAX_AGE_SECONDS
  • Added docs for the respective headers
  • Integration tests to confirm Allow Origin Headers are passed only for whitelisted Origins
  • Integration tests to check behaviour of preflight requests.

@punit-kulal punit-kulal self-assigned this Aug 30, 2023
@punit-kulal punit-kulal marked this pull request as ready for review August 30, 2023 06:19
.env.sample Show resolved Hide resolved
config/server.go Outdated Show resolved Hide resolved
config/server.go Outdated Show resolved Hide resolved
middleware/cors.go Show resolved Hide resolved
middleware/cors.go Show resolved Hide resolved
config/server.go Outdated Show resolved Hide resolved
.env.sample Outdated Show resolved Hide resolved
@prakharmathur82
Copy link
Member

Can we also add documentation for new configs and also mention how these configs will work in case of websocket

config/server.go Outdated Show resolved Hide resolved
@prakharmathur82 prakharmathur82 changed the title Cors support feat: add cors support Sep 5, 2023
@ravisuhag ravisuhag merged commit db7f808 into main Sep 9, 2023
6 checks passed
@ravisuhag ravisuhag deleted the cors-support branch September 9, 2023 14:37
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.

3 participants