17 lines
451 B
JavaScript
17 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();
|
||
|
};
|
||
|
}
|
||
|
};
|