Skip to content

Commit

Permalink
fix(Server): Disable x-powered-by in production (seek-oss#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
jahredhope authored May 13, 2019
1 parent d4c3b40 commit f60574d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions entry/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (env === 'development') {
app.use(express.static(path.join(__dirname, './')));
}

if (env !== 'development') {
// Disable x-powered-by header according to Express Best Practice
// https://expressjs.com/en/advanced/best-practice-security.html#at-a-minimum-disable-x-powered-by-header
app.disable('x-powered-by');
}

if (middleware) {
app.use(middleware);
}
Expand Down

0 comments on commit f60574d

Please sign in to comment.