This question already has an answer here:
I want to remove X-Powered-By for Security,Save Bandwidth in ExpressJS(node.js). how to do it? it could be filter(app.use) ?
app.use(function(req,res,next_cb){ /* remove X-Powered-By header */ next_cb(); }
This question already has an answer here:
I want to remove X-Powered-By for Security,Save Bandwidth in ExpressJS(node.js). how to do it? it could be filter(app.use) ?
app.use(function(req,res,next_cb){ /* remove X-Powered-By header */ next_cb(); }
The better way to do it is:
You can also make a middleware to remove any header like so:
See more info on how to remove a header:
http://nodejs.org/api/http.html#http_response_removeheader_name
Middleware snippet from: Can't get rid of header X-Powered-By:Express
Don't remove it; ask Express not to generate it in the first place:
https://stackoverflow.com/a/12484642/506073
Go to your
app.js
and just after:Add:
This was already answered here: Can't get rid of header X-Powered-By:Express
:)