csp: use template literals to avoid escaping single quotes
This commit is contained in:
parent
4310bb7157
commit
9cda8e3000
|
@ -8,17 +8,17 @@ const csp = (): AppMiddleware => {
|
|||
|
||||
const policies = [
|
||||
'upgrade-insecure-requests',
|
||||
'script-src \'self\'',
|
||||
`script-src 'self'`,
|
||||
`connect-src 'self' blob: ${Conf.localDomain} ${wsProtocol}//${host}`,
|
||||
`media-src 'self' ${Conf.mediaDomain}`,
|
||||
`img-src 'self' data: blob: ${Conf.mediaDomain}`,
|
||||
'default-src \'none\'',
|
||||
'base-uri \'self\'',
|
||||
'frame-ancestors \'none\'',
|
||||
'style-src \'self\' \'unsafe-inline\'',
|
||||
'font-src \'self\'',
|
||||
'manifest-src \'self\'',
|
||||
'frame-src \'self\' https:',
|
||||
`default-src 'none'`,
|
||||
`base-uri 'self'`,
|
||||
`frame-ancestors 'none'`,
|
||||
`style-src 'self' 'unsafe-inline'`,
|
||||
`font-src 'self'`,
|
||||
`manifest-src 'self'`,
|
||||
`frame-src 'self' https:`,
|
||||
];
|
||||
|
||||
c.res.headers.set('content-security-policy', policies.join('; '));
|
||||
|
|
Loading…
Reference in New Issue