You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

16 lines
424 B

"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();
};
};