Skip to content

Conversation

@GalacticHypernova
Copy link

@GalacticHypernova GalacticHypernova commented Oct 29, 2025

πŸ”— Linked issue

#1654

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

As continuation of #1654 , and with the approach of Nuxt Image v2, I think it is time to drop the nonce attribute.
As stated in the original issue, allowing users to inject their own nonce is very dangerous, as it doesn't enforce the nonce is cryptographically secure, generated according to the spec, or unique across the app. It is much better to let dedicated security modules like Nuxt Security handle the nonce generation.

This PR is marked as breaking as it changes behavior, even though it won't actually break any projects (except maybe failing to load images in certain projects that relied on the nonce prop) because it simply voids the property.

@GalacticHypernova GalacticHypernova marked this pull request as draft October 29, 2025 19:02
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 29, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@1995

commit: dc98a9f

@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2025

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 7.04%. Comparing base (6022fa8) to head (dc98a9f).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1995   +/-   ##
=====================================
  Coverage   7.03%   7.04%           
=====================================
  Files         77      77           
  Lines       3567    3565    -2     
  Branches     138     138           
=====================================
  Hits         251     251           
+ Misses      3268    3266    -2     
  Partials      48      48           

β˜” 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.

@GalacticHypernova GalacticHypernova marked this pull request as ready for review October 29, 2025 19:24
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