How to use the koa-helmet.dnsPrefetchControl function in koa-helmet

To help you get started, we’ve selected a few koa-helmet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github outline / outline / server / app.js View on Github external
'gist.github.com',
        'www.google-analytics.com',
        'd2wy8f7a9ursnm.cloudfront.net',
      ],
      styleSrc: ["'self'", "'unsafe-inline'", 'github.githubassets.com'],
      imgSrc: ['*', 'data:', 'blob:'],
      frameSrc: ['*'],
      connectSrc: compact([
        "'self'",
        process.env.AWS_S3_UPLOAD_BUCKET_URL,
        'www.google-analytics.com',
      ]),
    },
  })
);
app.use(dnsPrefetchControl({ allow: true }));
app.use(referrerPolicy({ policy: 'no-referrer' }));
app.use(mount(routes));

/**
 * Production updates and anonymous analytics.
 *
 * Set ENABLE_UPDATES=false to disable them for your installation
 */
if (
  process.env.ENABLE_UPDATES !== 'false' &&
  process.env.NODE_ENV === 'production'
) {
  updates();
  setInterval(updates, 24 * 3600 * 1000);
}