In Node.js/Express, how do I automatically add this header to every “render” response?

You probably want to use app.use with your own middleware:

app.use(function(req, res, next) {
    res.header('X-XSS-Protection', 0);
    next();
});

Leave a Comment