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

when corsHandler.origin is RegExp[], it doesn't work #497

Closed
Shana-AE opened this issue Jul 23, 2024 · 4 comments · Fixed by #498
Closed

when corsHandler.origin is RegExp[], it doesn't work #497

Shana-AE opened this issue Jul 23, 2024 · 4 comments · Fixed by #498
Labels
bug Something isn't working

Comments

@Shana-AE
Copy link
Contributor

Version

nuxt-security: v2.0.0-rc.9
nuxt: v3.12.4

Reproduction Link

image

image

useRuntimeConfig retrieve runtimeConfig from process.env which made RegExp inside origin be JSON.stringifyed to {}, so corsHandler.origin RegExp[] is not available now.

Steps to reproduce

What is Expected?

it should work

What is actually happening?

when corsHandler.origin is RegExp[], it doesn't work

@Shana-AE Shana-AE added the bug Something isn't working label Jul 23, 2024
@Baroshem Baroshem mentioned this issue Jul 26, 2024
6 tasks
@Baroshem
Copy link
Owner

Baroshem commented Aug 9, 2024

Hey @Shana-AE I needed to revert this change as we are not sure what do to about the serializaiton/deserialization issue :(

More details #492 (comment)

@Shana-AE
Copy link
Contributor Author

Shana-AE commented Aug 9, 2024

Hey @Shana-AE I needed to revert this change as we are not sure what do to about the serializaiton/deserialization issue :(

More details #492 (comment)

Ok, you can revert it as you wish :)
I just want to solve the problem and let it be solved as perfect as possible. and I'm not confident with this solution. If you have any other solution, just please let me know and show me the solution to let me improve myself. :)
and I also replied at #492 (comment) :) please check it:)

@P4sca1
Copy link
Contributor

P4sca1 commented Aug 9, 2024

@Shana-AE This should be fixed with #509.
Note that you need to pass regular expressions as strings and enable corsHandle.useRegExp.

@Baroshem
Copy link
Owner

Released in 2.0.0 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants