Socket
Socket
Sign inDemoInstall

hide-powered-by

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hide-powered-by

Middleware to remove the X-Powered-By header.


Version published
Weekly downloads
445K
increased by0.31%
Maintainers
1
Weekly downloads
 
Created

What is hide-powered-by?

The hide-powered-by npm package is used to remove or modify the X-Powered-By HTTP header in Express.js applications. This header is often used to identify the technology stack of a web application, and removing or changing it can help improve security by obscuring the underlying technology.

What are hide-powered-by's main functionalities?

Remove X-Powered-By Header

This feature removes the X-Powered-By header from the HTTP response. By default, Express.js includes this header to indicate that the server is powered by Express. Removing it can help obscure the technology stack from potential attackers.

const express = require('express');
const hidePoweredBy = require('hide-powered-by');

const app = express();
app.use(hidePoweredBy());

app.get('/', (req, res) => {
  res.send('Hello World!');
});

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

Set Custom X-Powered-By Header

This feature allows you to set a custom value for the X-Powered-By header. Instead of removing the header entirely, you can mislead potential attackers by setting it to a different value, such as 'PHP 4.2.0'.

const express = require('express');
const hidePoweredBy = require('hide-powered-by');

const app = express();
app.use(hidePoweredBy({ setTo: 'PHP 4.2.0' }));

app.get('/', (req, res) => {
  res.send('Hello World!');
});

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

Other packages similar to hide-powered-by

Keywords

FAQs

Package last updated on 18 Dec 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc