Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hex7c0/remove_date
remove Date header from http(s) response for Nodejs
https://github.com/hex7c0/remove_date
nodejs
Last synced: about 1 month ago
JSON representation
remove Date header from http(s) response for Nodejs
- Host: GitHub
- URL: https://github.com/hex7c0/remove_date
- Owner: hex7c0
- License: gpl-3.0
- Created: 2015-01-09T10:01:51.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T23:55:59.000Z (9 months ago)
- Last Synced: 2024-11-09T09:41:01.108Z (about 2 months ago)
- Topics: nodejs
- Language: JavaScript
- Homepage: https://github.com/hex7c0/remove_date
- Size: 96.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# [remove_date](https://github.com/hex7c0/remove_date)
[![NPM version](https://img.shields.io/npm/v/remove_date.svg)](https://www.npmjs.com/package/remove_date)
[![Linux Status](https://img.shields.io/travis/hex7c0/remove_date.svg?label=linux-osx)](https://travis-ci.org/hex7c0/remove_date)
[![Windows Status](https://img.shields.io/appveyor/ci/hex7c0/remove_date.svg?label=windows)](https://ci.appveyor.com/project/hex7c0/remove_date)
[![Dependency Status](https://img.shields.io/david/hex7c0/remove_date.svg)](https://david-dm.org/hex7c0/remove_date)
[![Coveralls](https://img.shields.io/coveralls/hex7c0/remove_date.svg)](https://coveralls.io/r/hex7c0/remove_date)Just a simple hack to remove [Date header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Date) from HTTP(S) response.
Similar to [remove_connection](https://github.com/hex7c0/remove_connection/)## Installation
Install through NPM
```bash
npm install remove_date
```
or
```bash
git clone git://github.com/hex7c0/remove_date.git
```## API
inside nodejs project
```js
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
```js
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](examples)
### [License GPLv3](LICENSE)