dijkstra-backend-cloudron/node_modules/dns-prefetch-control/dist/index.js

17 lines
424 B
JavaScript
Raw Normal View History

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