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

Content Security Policy Errors #199

Open
9mido opened this issue May 16, 2020 · 0 comments
Open

Content Security Policy Errors #199

9mido opened this issue May 16, 2020 · 0 comments

Comments

@9mido
Copy link

9mido commented May 16, 2020

Using the django-csp package, I get the following error repeated twice in the browser console for both pieces of code below because inline styling is being used:

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'. Either the 'unsafe-inline' keyword, a hash ('sha256-/hY9Yi5OpZMcXIYnTAVa79/aVAeq0Wn0Ahh5wBnXHd0='), or a nonce ('nonce-...') is required to enable inline execution.

<style>
    #dsr7828ac7bc96c4f578b1f749da1c31a73 .star-ratings-rating-full, #dsr7828ac7bc96c4f578b1f749da1c31a73 .star-ratings-rating-empty {
        width: 40px;
        height: 40px;
        background: url(/static/star-ratings/images/stars.png) no-repeat;
        background-size: 120px;
    }

    #dsr7828ac7bc96c4f578b1f749da1c31a73 .star-ratings-rating-empty {
        background-position: -40px 0;
    }

    
</style>

<ul class="star-ratings-rating-foreground" style="width: 60%">

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

No branches or pull requests

1 participant