0.0.6 • Published 5 years ago

express-headers v0.0.6

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

What is this?

Simple express middleware to validate headers

Usage

headers.validate(name [, value]) //Validates the existance of a header and its value
headers.rename(from, to) //Renames header 'from' to 'to'

Example

var express = require("express");
var app = express();
var headers = require("express-headers");

app.use(headers.rename("x-auth-token", "authorization")); //rename x-auth-token to authorization header
app.use(headers.validate("authorization")); //make sure there's an authorization header in the request
app.use(headers.validate("content-type", "application/json")); //make sure there's a content-type header matching application/json
...
0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago