mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
add csp for CloudFlare analytics
This commit is contained in:
@@ -5,6 +5,7 @@ function generateCspPolicy() {
|
||||
const policyDescriptor = mergeDescriptors(
|
||||
descriptors.app(),
|
||||
descriptors.ad(),
|
||||
descriptors.cloudFlare(),
|
||||
descriptors.googleAnalytics(),
|
||||
descriptors.googleFonts(),
|
||||
descriptors.googleReCaptcha(),
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import type CspDev from 'csp-dev';
|
||||
|
||||
import { KEY_WORDS } from '../utils';
|
||||
|
||||
// CloudFlare analytics
|
||||
export function cloudFlare(): CspDev.DirectiveDescriptor {
|
||||
return {
|
||||
'script-src': [
|
||||
'static.cloudflareinsights.com',
|
||||
],
|
||||
'style-src': [
|
||||
KEY_WORDS.DATA,
|
||||
],
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
export { ad } from './ad';
|
||||
export { app } from './app';
|
||||
export { cloudFlare } from './cloudFlare';
|
||||
export { googleAnalytics } from './googleAnalytics';
|
||||
export { googleFonts } from './googleFonts';
|
||||
export { googleReCaptcha } from './googleReCaptcha';
|
||||
|
||||
Reference in New Issue
Block a user