Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
haskell-gargantext
haskell-gargantext
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 154
    • Issues 154
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 7
    • Merge Requests 7
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gargantext
  • haskell-gargantexthaskell-gargantext
  • Merge Requests
  • !244

Merged
Opened Feb 05, 2024 by Alfredo Di Napoli@AlfredoDiNapoli
  • Report abuse
Report abuse

Improve CORS support

(Waiting for CI before removing the WIP label.)

@anoe I have implemented a bunch of fixes/improvements around the way we were handling CORS requests. Now, at least for multiple localhost instances, this is working as intended:

Screenshot_2024-02-05_at_14.45.45

Read me

There is important change:

  1. I have added a new file called gargantext-cors-settings.toml which uses TOML a config language similar to .ini (but with better support for things like lists etc) to define a list of allowed origins that our server will accept for CORS requests. Unfortunately we cannot use wildcards as that's rejected by the RFC6454, so we need to be explicit. If we ever decide to add more hosts, we need to remember to extend this file and restart the server.

Now, I think that as far as Nginx goes, we shouldn't need to amend it, because I think the problem we were getting in #302 (closed) was that the frontend started to pass the x-garg-error-scheme, HTTP header, and that, per our CORS policy, wasn't exposed, and thus we were getting a rejection. In theory if you re-deploy the servers (for example demo and/or dev.sub) things should work now.

If they don't, we can look at the individual logs to further drill down to the problem.

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b adinapoli/issue-302 origin/adinapoli/issue-302

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/dev
git merge --no-ff adinapoli/issue-302

Step 4. Push the result of the merge to GitLab

git push origin dev

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 0
  • Commits 3
  • Pipelines 4
  • Changes 10
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
1
Labels
Ready to merge
Assign labels
  • View project labels
Reference: gargantext/haskell-gargantext!244

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.