Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

dns-prefetch-control

helmetjs525.4kMIT0.3.0TypeScript support: included

Middleware to set X-DNS-Prefetch-Control header.

helmet, security, express, connect, x-dns-prefetch-control, dns, prefetch

readme

DNS prefetch control header for Express

Build Status

This middleware lets you set the X-DNS-Prefetch-Control to control browsers' DNS prefetching. Read more about it on MDN and on Chromium's docs.

Usage:

const dnsPrefetchControl = require('dns-prefetch-control')

// Set X-DNS-Prefetch-Control: off
app.use(dnsPrefetchControl())

// Set X-DNS-Prefetch-Control: off
app.use(dnsPrefetchControl({ allow: false }))

// Set X-DNS-Prefetch-Control: on
app.use(dnsPrefetchControl({ allow: true }))

changelog

Changelog

0.3.0 - 2019-09-01

Changed

  • Dropped support for Node <8

0.2.0 - 2019-05-11

Added

Changed

  • Update some package metadata
  • Excluded some files from npm package

Changes in versions 0.1.0 and below can be found in Helmet's changelog.