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

12 lines
409 B
JavaScript
Raw Normal View History

2020-11-17 21:44:32 +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;