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: change CORS to allow origin app://- #5

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Nov 9, 2023

The origin of the Electron app depends on how we run the app.

In this commit, I am changing our CORS header to be either http://localhost:3000 or app://-, depending on what the client sends in the request header "Origin".

The origin of the Electron app depends on how we run the app.
 - via `npm start` -> origin is http://localhost:3000
 - packaged -> origin is app://-

In this commit, I am changing our CORS header to be either
`http://localhost:3000` or `app://-`, depending on what
the client sends in the request header "Origin".

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos
Copy link
Member Author

bajtos commented Nov 9, 2023

@juliangruber hindsight please 🙏🏻

Do we want to add any tests for this?

@bajtos bajtos merged commit 2f05979 into main Nov 9, 2023
1 check passed
@bajtos bajtos deleted the fix-cors-for-packaged-app branch November 9, 2023 09:36
Copy link
Member

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

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

Thank you for stepping in, change looks great!

@juliangruber
Copy link
Member

Do we want to add any tests for this?

I don't see the need, but would be nice

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.

2 participants