x-echo

0.9.1 • Public • Published

x-echo

NPM

NPM

Description

node.js module to echo http request headers

Badges

dependencies

Installation

npm install x-echo

Usage

Server side

Require the module

var xecho = require('x-echo');
  • Echo all http request headers:
app.use(xecho());
  • Echo some http request headers:
app.use(xecho(['accept-language', 'user-agent']));
  • Echo one http request header:
app.use(xecho('accept-language'));

X-Echo response headers

All the requested headers will be echoed with lower-case keys and 'x-echo-' prefix:

Cache-Control:no-cache
Connection:keep-alive
Content-Type:text/plain; charset=utf-8
Date:Mon, 11 Aug 2014 06:57:50 GMT
x-echo-accept:text/event-stream
x-echo-accept-language:en-US,en;q=0.8,hu;q=0.6,he;q=0.4
X-Powered-By:Express

License

GNU GENERAL PUBLIC LICENSE

Credits

This module was written by Gavriel Fleischer x-echo

The idea came from: http://stackoverflow.com/questions/1043339/javascript-for-detecting-browser-language-preference

Change log

v1.0

  • first release.

Package Sidebar

Install

npm i x-echo

Weekly Downloads

0

Version

0.9.1

License

GNU

Last publish

Collaborators

  • flocsy