]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/csp.ts
Prevent object storage mock conflicts
[github/Chocobozzz/PeerTube.git] / server / middlewares / csp.ts
index 0ee44bf4782a1c446d82584e37592420e00de2cf..e2a75a17ebae7427e70bf6da5ca2e9782bfdd48b 100644 (file)
@@ -1,4 +1,4 @@
-import * as helmet from 'helmet'
+import { contentSecurityPolicy } from 'helmet'
 import { CONFIG } from '../initializers/config'
 
 const baseDirectives = Object.assign({},
@@ -22,12 +22,12 @@ const baseDirectives = Object.assign({},
   CONFIG.WEBSERVER.SCHEME === 'https' ? { upgradeInsecureRequests: [] } : {}
 )
 
-const baseCSP = helmet.contentSecurityPolicy({
+const baseCSP = contentSecurityPolicy({
   directives: baseDirectives,
   reportOnly: CONFIG.CSP.REPORT_ONLY
 })
 
-const embedCSP = helmet.contentSecurityPolicy({
+const embedCSP = contentSecurityPolicy({
   directives: Object.assign({}, baseDirectives, { frameAncestors: [ '*' ] }),
   reportOnly: CONFIG.CSP.REPORT_ONLY
 })