Skip to content

[6.x] Remove the X-Powered-By header - #7554

Open
UlisesGascon wants to merge 1 commit into
masterfrom
ulises/6x-remove-x-powered-by
Open

UlisesGascon wants to merge 1 commit into
masterfrom
ulises/6x-remove-x-powered-by

Conversation

@UlisesGascon

Copy link
Copy Markdown
Member

⚠️ Breaking changes

  • The X-Powered-By: Express header is no longer sent and the x-powered-by setting is removed. app.enable('x-powered-by') and app.disable('x-powered-by') no longer have any effect; set the header in a middleware if you need it

    app.use((req, res, next) => {
      res.set('X-Powered-By', 'Express');
      next();
    });

BREAKING CHANGE: the X-Powered-By header is no longer sent and the
x-powered-by setting has no effect.
@UlisesGascon UlisesGascon added 6.x semver-major This change is a semver major labels Oct 23, 2026
@UlisesGascon

Copy link
Copy Markdown
Member Author

If we agree on this one... not sure if we need a deprecation message on express@5 🤔

@bjohansebas bjohansebas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 on this. Why remove it? Though I also wonder why we should keep it.

@Phillip9587

Copy link
Copy Markdown
Member

helmet removes it and specifies the following reason (https://helmet.js.org/):

Helmet removes the X-Powered-By header, which is set by default in Express and some other frameworks. Removing the header offers very limited security benefits (see this discussion) and is mostly removed to save bandwidth, but may thwart simplistic attackers.

And links this express issue: #2813 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.x semver-major This change is a semver major

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants