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

Readme

Keywords

Package Sidebar

Install

npm i remove_date

Weekly Downloads

0

Version

0.5.0

License

GPL-3.0

Last publish

Collaborators

  • hex7c0