Skip to content

Commit

Permalink
Merge pull request #414 from Baroshem/vejja/issue413
Browse files Browse the repository at this point in the history
Vejja/issue413
  • Loading branch information
Baroshem committed Apr 7, 2024
2 parents d0a3c3f + 9c81c17 commit a5be7f3
Show file tree
Hide file tree
Showing 3 changed files with 1,136 additions and 879 deletions.
4 changes: 2 additions & 2 deletions src/runtime/nitro/plugins/03-subresourceIntegrity.ts
Expand Up @@ -22,8 +22,8 @@ export default defineNitroPlugin((nitroApp) => {
// But we did save the /integrity directory into the server assets
const prerendering = isPrerendering(event)
const storageBase = prerendering ? 'build' : 'assets'
const sriHashesRaw = await useStorage(storageBase).getItemRaw<Uint8Array>('integrity:sriHashes.json')
const sriHashes: Record<string, string> = sriHashesRaw ? JSON.parse(new TextDecoder().decode(sriHashesRaw)) : {}
const sriHashes = await useStorage(storageBase).getItem<Record<string, string>>('integrity:sriHashes.json') || {}


// Scan all relevant sections of the NuxtRenderHtmlContext
// Note: integrity can only be set on scripts and on links with rel preload, modulepreload and stylesheet
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/nitro/plugins/99-cspSsrNonce.ts
@@ -1,4 +1,4 @@
import { defineNitroPlugin, getRouteRules, setResponseHeader } from '#imports'
import { defineNitroPlugin, getRouteRules, setResponseHeader, getResponseHeaders } from '#imports'
import { type CheerioAPI } from 'cheerio'
import { isPrerendering } from '../utils'
import type { H3Event } from "h3"
Expand Down

0 comments on commit a5be7f3

Please sign in to comment.