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

Fix CORS origin localhost entry #205

Merged
merged 4 commits into from
Oct 2, 2024
Merged

Fix CORS origin localhost entry #205

merged 4 commits into from
Oct 2, 2024

Conversation

cherylli
Copy link
Contributor

Description

Current CORS origin entry for localhost is wrong - http://localhost:* does not match all port, its just a static string, we need to use regex

Issue link

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature updates / changes
  • Tests
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

tested on a dummy next.js client component (as CORS has no effect on server components)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have updated the change log

@cherylli cherylli self-assigned this Sep 19, 2024
@cherylli cherylli requested review from curtwl and timDeHof September 19, 2024 15:05
curtwl
curtwl previously approved these changes Sep 22, 2024
Copy link
Contributor

@curtwl curtwl left a comment

Choose a reason for hiding this comment

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

Connecting to frontend works and tests all pass

@cherylli cherylli added the medium Priority label Sep 23, 2024
@cherylli
Copy link
Contributor Author

@timDeHof @curtwl are you able to (re-)review this? Thanks! Reviews got staled after merging dev 😂

@Dan-Y-Ko Dan-Y-Ko self-requested a review October 2, 2024 03:49
Copy link
Contributor

@Dan-Y-Ko Dan-Y-Ko left a comment

Choose a reason for hiding this comment

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

Tested with a dummy fe app:

works, getting 200 as expected.

screenshot

Copy link
Contributor

@timDeHof timDeHof left a comment

Choose a reason for hiding this comment

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

I got it to work with the curl command curl -v --request OPTIONS 'http://localhost:8000' -H 'Origin: http://localhost:3045' -H 'Access-Control-Request-Method: Get' with the server running. I got a HTTP/1.1 204 No Content response.
Screenshot 2024-10-02 at 12 04 23 AM

@cherylli cherylli merged commit 8377a01 into dev Oct 2, 2024
1 check passed
@cherylli cherylli deleted the fix/cors-origin branch October 2, 2024 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants