You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently Content Security Policy (CSP) support was added (see: #16052). However, the injection process behaves incorrectly on elements that do not have a closing tag.
For example: <link rel="stylesheet" href="/roboto.css" />
Becomes this with the current CSP injection behavior: <link rel="stylesheet" href="/roboto.css" / nonce="abc123">
But it should become: <link rel="stylesheet" href="/roboto.css" nonce="abc123"/>
This is caused by an offset in the injection function being statically set to 1.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
Recently Content Security Policy (CSP) support was added (see: #16052). However, the injection process behaves incorrectly on elements that do not have a closing tag.
For example:
<link rel="stylesheet" href="/roboto.css" />
Becomes this with the current CSP injection behavior:
<link rel="stylesheet" href="/roboto.css" / nonce="abc123">
But it should become:
<link rel="stylesheet" href="/roboto.css" nonce="abc123"/>
This is caused by an offset in the injection function being statically set to 1.
Reproduction
https://github.com/gregtwallace/legocerthub-frontend
Steps to reproduce
Set the following in the vite config:
Add a stylesheet link to the index.html file:
Run
npx vite
open the app in a browser, and view the source code that is served.System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: