Skip to content

fix: Add script nonce to <link as=script> #850

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

Merged
merged 2 commits into from
Apr 2, 2025
Merged

Conversation

andreituicu
Copy link
Collaborator

While testing the feature for https://www.jcperreault.com/ , I noticed that they have a case which is not covered by the current code.

The browser will block the download of the following script, without the correct nonce value.

<link rel="preload" href="/scripts/lib/swiper/swiper-bundle.min.js" as="script">

Copy link

codecov bot commented Mar 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (c5de067) to head (c1a7bad).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #850   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           46        46           
  Lines         3989      4015   +26     
=========================================
+ Hits          3989      4015   +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

This PR will trigger a minor release when merged.

@andreituicu andreituicu changed the title wip: feat: Add script nonce to <link as=script> feat: Add script nonce to <link as=script> Apr 1, 2025
@andreituicu andreituicu requested a review from tripodsan April 1, 2025 09:46
@andreituicu andreituicu changed the title feat: Add script nonce to <link as=script> fix: Add script nonce to <link as=script> Apr 1, 2025
@andreituicu andreituicu merged commit 182f281 into main Apr 2, 2025
9 checks passed
@andreituicu andreituicu deleted the link-as-script branch April 2, 2025 11:47
github-actions bot pushed a commit that referenced this pull request Apr 2, 2025
## [6.24.2](v6.24.1...v6.24.2) (2025-04-02)

### Bug Fixes

* Add script nonce to <link as=script> ([#850](#850)) ([182f281](182f281))
Copy link

github-actions bot commented Apr 2, 2025

🎉 This PR is included in version 6.24.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants