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 an option to disable cross origin policy #1553

Closed
OlaviSau opened this issue Sep 25, 2024 · 2 comments
Closed

Add an option to disable cross origin policy #1553

OlaviSau opened this issue Sep 25, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@OlaviSau
Copy link
Contributor

Is your feature request related to a problem? Please describe.
We use multiple domains in our project and the API for server context assumes no CORS. Currently we are using patch-package to fix this, but I think disabling CORS would be a common use case for happy DOM.

Describe the solution you'd like
I want to be able to disable CORS for Fetch / SyncFetch.

Describe alternatives you've considered
We can either rearchitect our API, use patch-package or fork this project, none are ideal.

Additional context
I have a example PR.

@OlaviSau OlaviSau added the enhancement New feature or request label Sep 25, 2024
@OlaviSau
Copy link
Contributor Author

#1554

capricorn86 added a commit to OlaviSau/happy-dom that referenced this issue Nov 5, 2024
capricorn86 added a commit to OlaviSau/happy-dom that referenced this issue Nov 5, 2024
capricorn86 added a commit that referenced this issue Nov 5, 2024
…le to bypass the same-origin policy (CORS) (#1554)

* feat: [1553] Add disableCrossOriginPolicy setting to disable cors in the browser

* chore: [#1553] Adds unit tests and changes name on setting for disabling same-origin policy

* chore: [#1553] Adds unit tests and changes name on setting for disabling same-origin policy

---------

Co-authored-by: David Ortner <david@ortner.se>
@capricorn86
Copy link
Owner

Thank you again @OlaviSau for your contribution! ⭐

The fix is now in.

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v15.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants