Skip to content

Commit

Permalink
Modifies some content security policy settings
Browse files Browse the repository at this point in the history
  • Loading branch information
i8beef committed Jan 5, 2023
1 parent fd0d654 commit 6d50521
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/HomeAutio.Mqtt.GoogleHome/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
@RenderBody()
</div>

<script src="https://code.jquery.com/jquery-3.6.3.min.js" crossorigin="anonymous"></script>
<script src="~/lib/jquery/jquery-3.6.3.min.js"></script>
<script src="~/lib/styleswitcher/styleswitcher.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="~/lib/bootstrap/bootstrap-5.2.3.bundle.min.js"></script>

@RenderSection("scripts", required: false)
</body>
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ public override void OnResultExecuting(ResultExecutingContext context)
}

// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
var csp = "default-src 'self'; object-src 'none'; frame-ancestors 'none'; sandbox allow-forms allow-same-origin allow-scripts; base-uri 'self';";
//var csp = "default-src 'self'; object-src 'none'; frame-ancestors 'none'; sandbox allow-forms allow-same-origin allow-scripts; base-uri 'self';";

// The above is a bunch of bullshit, open it up
var csp = "default-src 'self'; img-src 'self' data:; style-src 'self' fonts.googleapis.com; font-src 'self' fonts.gstatic.com; object-src 'none'; frame-ancestors 'none'; sandbox allow-forms allow-same-origin allow-scripts; base-uri 'self';";
// also consider adding upgrade-insecure-requests once you have HTTPS in place for production
//csp += "upgrade-insecure-requests;";
// also an example if you need client images to be displayed from twitter
Expand Down

0 comments on commit 6d50521

Please sign in to comment.