npm

Join us for the "JavaScript Supply Chain Security" tech talk, presented by VP of Security, Adam Baldwin. 6/20 at 10am PT.Sign up here »

remove_date

0.5.0 • Public • Published

remove_date

NPM version Linux Status Windows Status Dependency Status Coveralls

Just a simple hack to remove Date header from HTTP(S) response. Similar to remove_connection

Installation

Install through NPM

npm install remove_date

or

git clone git://github.com/hex7c0/remove_date.git

API

inside nodejs project

var setDate = require('remove_date');
 
require('http').createServer(function(req, res) {
 
  setDate(res); // remove Date header from response
 
  res.writeHead(200, {
    'Content-Type': 'text/plain'
  });
  res.end('Hello World\n');
}).listen(3000, '127.0.0.1');

as middleware

var setDate = require('remove_date').setDateMiddleware;
var app = require('express')();
 
app.use(setDate()).get('/', function(req, res) {
 
  res.end('Hello World\n');
}).listen(3000, '127.0.0.1');

setDate(res [, setHeader])

options

  • res - Object response to client (default "required")
  • setHeader- Boolean setHeader block (default "optional")

setDateMiddleware([setHeader])

options

  • setHeader- Boolean setHeader block (default "optional")

Examples

Take a look at my examples

License GPLv3

Keywords

install

npm i remove_date

Downloadsweekly downloads

9

version

0.5.0

license

GPL-3.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability