Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
106
rated 0 times [  112] [ 6]  / answers: 1 / hits: 51539  / 13 Years ago, tue, may 3, 2011, 12:00:00

I am running a server on nodejs with express. I can't seem to get rid of the header:



X-Powered-By:Express


I was wondering if there is any way to get rid of this header or do I have to live with it?


More From » node.js

 Answers
11

In Express >= 3.0.0rc5:



app.disable('x-powered-by');


Here is a simple middleware that removes the header in earlier versions of Express:



app.use(function (req, res, next) {
res.removeHeader(x-powered-by);
next();
});

[#92436] Saturday, April 30, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aileent

Total Points: 556
Total Questions: 107
Total Answers: 101

Location: Croatia
Member since Fri, Sep 11, 2020
4 Years ago
;