express-honeypots
Version:
This repository contains a collection of honeypots for the Express framework to prevent automated scanning.
15 lines (11 loc) • 337 B
JavaScript
/**
* This is a simple honeypot that will set the x-powered-by header to a specific PHP version.
*/
export default function(router, options = {
phpVersion: undefined
}) {
router.use((req, res, next) => {
res.setHeader('x-powered-by', options.phpVersion || 'PHP/4.3.11' );
next();
});
}