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

feat: add strictContentSecurityPolicy compatibility rule #569

Merged

Conversation

markwhitfeld
Copy link
Member

Setting the config option of strictContentSecurityPolicy to true will avoid CSP violations

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[X] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #516 #439

What is the new behavior?

Add a config setting to allow for a strict Content Security Policy.
There will be a small performance hit to selectors because this circumvents an optimisation.
This should be provided in the ngxs options to the root module as follows:

NgxsModule.forRoot([
      ZooState
    ], {
      compatibility: {
        strictContentSecurityPolicy: true
      }
    })

Does this PR introduce a breaking change?

[ ] Yes
[X] No

Other information

Setting the config option of strictContentSecurityPolicy to true will avoid CSP violations
@markwhitfeld markwhitfeld requested a review from amcdnl September 13, 2018 21:46
@ghost
Copy link

ghost commented Sep 14, 2018

@markwhitfeld @amcdnl Can this be merged and released soon. This issue is blocking us and determines whether we move on with this library or another. Thanks for getting the pr up so quickly also. I really want to use this library

Copy link
Member

@deebloo deebloo left a comment

Choose a reason for hiding this comment

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

Code looks fine. I don't really understand the issue though so I trust ya 😉

@markwhitfeld markwhitfeld merged commit 5829c9f into ngxs:master Sep 23, 2018
@markwhitfeld markwhitfeld added this to the 3.3.0 milestone Oct 13, 2018
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