benji.monster/node_modules/hide-powered-by/dist/index.js
2020-01-03 21:48:09 +01:00

16 lines
451 B
JavaScript

"use strict";
module.exports = function hidePoweredBy(options) {
var _a = (options || {}).setTo, setTo = _a === void 0 ? null : _a;
if (setTo) {
return function hidePoweredBy(_req, res, next) {
res.setHeader('X-Powered-By', setTo);
next();
};
}
else {
return function hidePoweredBy(_req, res, next) {
res.removeHeader('X-Powered-By');
next();
};
}
};