Skip to content

Commit 45aa0e7

Browse files
authored
chore(app-vite/docs/ui): disable x-powered-by header (#13318)
1 parent 2a7f96b commit 45aa0e7

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

app-vite/templates/ssr/server.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import compression from 'compression'
2222
export function create (/* { ... } */) {
2323
const app = express()
2424

25+
// attackers can use this header to detect apps running Express
26+
// and then launch specifically-targeted attacks
27+
app.disable('x-powered-by')
28+
2529
// place here any middlewares that
2630
// absolutely need to run before anything else
2731
if (process.env.PROD) {

docs/src-ssr/server.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import compression from 'compression'
2222
export function create (/* { ... } */) {
2323
const app = express()
2424

25+
// attackers can use this header to detect apps running Express
26+
// and then launch specifically-targeted attacks
27+
app.disable('x-powered-by')
28+
2529
// place here any middlewares that
2630
// absolutely need to run before anything else
2731
if (process.env.PROD) {

docs/src/pages/quasar-cli-vite/developing-ssr/ssr-webserver.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ import compression from 'compression'
3838
export function create (/* { ... } */) {
3939
const app = express()
4040

41+
// attackers can use this header to detect apps running Express
42+
// and then launch specifically-targeted attacks
43+
app.disable('x-powered-by')
44+
4145
// place here any middlewares that
4246
// absolutely need to run before anything else
4347
if (process.env.PROD) {

ui/dev/src-ssr/server.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import compression from 'compression'
2222
export function create (/* { ... } */) {
2323
const app = express()
2424

25+
// attackers can use this header to detect apps running Express
26+
// and then launch specifically-targeted attacks
27+
app.disable('x-powered-by')
28+
2529
// place here any middlewares that
2630
// absolutely need to run before anything else
2731
if (process.env.PROD) {

0 commit comments

Comments
 (0)