Skip to content
middleware to set X-DNS-Prefetch-Control header
TypeScript
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Convert module to TypeScript May 11, 2019
.eslintignore Convert module to TypeScript May 11, 2019
.eslintrc.json Convert module to TypeScript May 11, 2019
.gitignore
.travis.yml Drop support for Node <8 Sep 1, 2019
CHANGELOG.md
LICENSE Update license year for 2019 Jan 7, 2019
README.md Add a changelog May 11, 2019
index.ts
package-lock.json Update devDependencies to latest versions Dec 28, 2019
package.json Update devDependencies to latest versions Dec 28, 2019
tsconfig.json Convert module to TypeScript May 11, 2019

README.md

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 }))
You can’t perform that action at this time.