File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
packages/kit/src/runtime/server/page Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @sveltejs/kit ' : patch
3+ ---
4+
5+ [ fix] don't add nonce attribute to ` <link> ` elements
Original file line number Diff line number Diff line change @@ -211,22 +211,17 @@ export async function render_response({
211211 const path = prefixed ( dep ) ;
212212
213213 if ( resolve_opts . preload ( { type : 'css' , path } ) ) {
214- const attributes = [ ] ;
215-
216- if ( csp . style_needs_nonce ) {
217- attributes . push ( `nonce="${ csp . nonce } "` ) ;
218- }
214+ const attributes = [ 'rel="stylesheet"' ] ;
219215
220216 if ( inline_styles . has ( dep ) ) {
221217 // don't load stylesheets that are already inlined
222218 // include them in disabled state so that Vite can detect them and doesn't try to add them
223219 attributes . push ( 'disabled' , 'media="(max-width: 0)"' ) ;
224220 } else {
225- const preload_atts = [ 'rel="preload"' , 'as="style"' ] . concat ( attributes ) ;
221+ const preload_atts = [ 'rel="preload"' , 'as="style"' ] ;
226222 link_header_preloads . add ( `<${ encodeURI ( path ) } >; ${ preload_atts . join ( ';' ) } ; nopush` ) ;
227223 }
228224
229- attributes . unshift ( 'rel="stylesheet"' ) ;
230225 head += `\n\t\t<link href="${ path } " ${ attributes . join ( ' ' ) } >` ;
231226 }
232227 }
You can’t perform that action at this time.
0 commit comments