github Baroshem/nuxt-security v2.0.0-rc.7
2.0.0-rc.7

latest releases: v2.6.0, v2.5.1, v2.5.0...
pre-release23 months ago

Support for #478

This new version updates the regular expressions in the 30-cspSsgHashes.ts file. The previous regular expression was not correctly capturing the content of inline script and style tags in all scenarios.

The old regular expression for inline scripts:

const INLINE_SCRIPT_RE = /<script(?![^>]?\bsrc="[\w:.-\/]+")[^>]>(.*?)</script>/gi
The updated regular expression:

const INLINE_SCRIPT_RE = /<script(?![^>]?\bsrc="[\w:.-\/]+")[^>]>([\s\S]?)</script>/gi;
The change from (.
?) to ([\s\S]*?) ensures that the regular expression matches any character, including newlines, between the <script> and </script> tags. This change improves the accuracy of inline script content capture, ensuring that our CSP security hashes are correctly generated for all inline scripts.

What's Changed

  • add per route csrf to docs by @moshetanzer in #471
  • fix(csp): inline script/style have whitespace character by @hlhc in #478

New Contributors

Full Changelog: v2.0.0-rc.6...v2.0.0-rc.7

Don't miss a new nuxt-security release

NewReleases is sending notifications on new releases.