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

Add CORS support to the HTTP GraphQL API endpoint #408

Closed
jsimnz opened this issue May 5, 2022 · 1 comment · Fixed by #467
Closed

Add CORS support to the HTTP GraphQL API endpoint #408

jsimnz opened this issue May 5, 2022 · 1 comment · Fixed by #467
Assignees
Labels
area/api Related to the external API component config-change feature New feature or request
Milestone

Comments

@jsimnz
Copy link
Member

jsimnz commented May 5, 2022

Since this is a user-centric database, it is likely (design to be) used directly by some client, potentially from a browser. In that usecase, we need to support CORS to properly respond across domains.

CORS Chi middleware: https://github.com/go-chi/cors

@jsimnz jsimnz added feature New feature or request area/api Related to the external API component labels May 5, 2022
@jsimnz jsimnz added this to the DefraDB v0.3 milestone May 5, 2022
@orpheuslummis
Copy link
Contributor

I recommend including a configuration parameter to provide the list of domains from which to accept cross origin requests (browser enforced).

fredcarle added a commit that referenced this issue Jun 8, 2022
RELEVANT ISSUE(S)
Resolves #408

DESCRIPTION
This PR adds CORS capability to the HTTP API. In situations where the database will be accessed from a different domain than that of the Defra host, the HTTP API needs to communicate to the browser the allowed origins and handle preflight requests.
shahzadlone pushed a commit to shahzadlone/defradb that referenced this issue Feb 23, 2024
RELEVANT ISSUE(S)
Resolves sourcenetwork#408

DESCRIPTION
This PR adds CORS capability to the HTTP API. In situations where the database will be accessed from a different domain than that of the Defra host, the HTTP API needs to communicate to the browser the allowed origins and handle preflight requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Related to the external API component config-change feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants