Skip to content

Commit

Permalink
Revert "add hashStyles option to Interface"
Browse files Browse the repository at this point in the history
This reverts commit 32a2b43.
  • Loading branch information
vejja committed Nov 1, 2023
1 parent a999dca commit 442993b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/defaultConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ModuleOptions } from './types'
import { ModuleOptions } from './types'

const defaultThrowErrorValue = { throwError: true }

Expand Down Expand Up @@ -81,7 +81,6 @@ export const defaultSecurityConfig = (serverlUrl: string): ModuleOptions => ({
exclude: [/node_modules/, /\.git/]
},
ssg: {
hashScripts: true,
hashStyles: false
hashScripts: true
}
})
2 changes: 1 addition & 1 deletion src/runtime/nitro/plugins/02-cspSsg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default defineNitroPlugin((nitroApp) => {
// Remove '""'
tagPolicies['script-src'] = (tagPolicies['script-src'] ?? []).concat(scriptHashes)
}
if (styleHashes.length > 0 && moduleOptions.ssg?.hashStyles) {
if (styleHashes.length > 0 && moduleOptions.ssg?.hashScripts) {
// Remove '""'
tagPolicies['style-src'] = (tagPolicies['style-src'] ?? []).concat(styleHashes)
}
Expand Down
1 change: 0 additions & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { AllowedHTTPMethods, BasicAuth, CorsOptions, RateLimiter, RequestSi

export type Ssg = {
hashScripts?: boolean;
hashStyles?: boolean;
};

export interface ModuleOptions {
Expand Down

0 comments on commit 442993b

Please sign in to comment.