Socket
Socket
Sign inDemoInstall

hide-powered-by

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

hide-powered-by

Middleware to remove the X-Powered-By header


Version published
Maintainers
1
Weekly downloads
487,815
decreased by-2.65%
Install size
5.72 kB

Weekly downloads

Readme

Source

Hide X-Powered-By

Build Status

Simple middleware to remove the X-Powered-By HTTP header if it's set.

Hackers can exploit known vulnerabilities in Express/Node if they see that your site is powered by Express (or whichever framework you use). For example, X-Powered-By: Express is sent in every HTTP request coming from Express, by default. This won't provide much security benefit (as discussed here), but might help a tiny bit. It will also improve performance by reducing the number of bytes sent.

const hidePoweredBy = require('hide-powered-by')
app.use(hidePoweredBy())

You can also explicitly set the header to something else, if you want. This could throw people off:

app.use(hidePoweredBy({ setTo: 'PHP 4.2.0' }))

Note: if you're using Express, you don't need this middleware and can just do this:

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

Keywords

FAQs

Last updated on 26 May 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc