benji.monster/node_modules/dns-prefetch-control/dist/index.js
2020-01-03 21:48:09 +01:00

16 lines
424 B
JavaScript

"use strict";
function getHeaderValueFromOptions(options) {
if (options && options.allow) {
return 'on';
}
else {
return 'off';
}
}
module.exports = function dnsPrefetchControl(options) {
var headerValue = getHeaderValueFromOptions(options);
return function dnsPrefetchControl(_req, res, next) {
res.setHeader('X-DNS-Prefetch-Control', headerValue);
next();
};
};