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

Replace JS eval with split/reduce call #46

Merged
merged 1 commit into from
Jan 21, 2020
Merged

Conversation

barthez
Copy link
Contributor

@barthez barthez commented Jan 9, 2020

Hello @geolessel

In default CSP (content security policy) setup eval is disabled. The code can be easily replaced by split/reduce keeping the logic but avoiding eval.

It could be a breaking change if someone was (ab)using this implementation and passing some js code to react_component function call.

Looking forward to your feedback.

In default CSP setup `eval` is disabled. The code can be easily
replaced by split/reduce keeping the logic but avoiding `eval`.
@barthez barthez requested a review from geolessel January 20, 2020 11:20
Copy link
Owner

@geolessel geolessel left a comment

Choose a reason for hiding this comment

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

This is great, thank you. I never liked that eval and I'm glad to see it go.

@geolessel geolessel merged commit 681b291 into geolessel:master Jan 21, 2020
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