DiscofyAPI/node_modules/helmet/dist/middlewares/x-dns-prefetch-control/index.js

12 lines
380 B
JavaScript
Raw Permalink Normal View History

2021-03-25 17:23:36 +01:00
"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
function xDnsPrefetchControl(options = {}) {
const headerValue = options.allow ? "on" : "off"
return function xDnsPrefetchControlMiddleware(_req, res, next) {
res.setHeader("X-DNS-Prefetch-Control", headerValue)
next()
}
}
module.exports = xDnsPrefetchControl
exports.default = xDnsPrefetchControl