request-headers-filter
v1.0.5
Published
Filter headers from request which will be passed to new request and/or response
Downloads
6
Maintainers
Readme
Request headers filter
Filter headers from request which will be passed to new request and/or response
Installation
via npm
npm install --save request-headers-filter
or Yarn
yarn add request-headers-filter
Example
const express = require('express');
const request = require('request');
const requestHeadersFilter = require('request-headers-filter');
const app = express();
app.get('/', (req, res) => {
const requestStream = request('https://github.com/L2jLiga/request-headers-filter');
requestHeadersFilter.saveHeaders(requestStream, res, ['content-type', 'cookie']);
req.pipe(requestStream).pipe(res);
});
Usefull cases
- When you want to save several headers
- When you use Transform stream to change response