1.0.2 • Published 9 years ago

7239 v1.0.2

Weekly downloads
63
License
ISC
Repository
github
Last release
9 years ago

7239

Build status

A module to parse Forwarded headers according to RFC 7239.

const sttn = require('7239');

sttn.parseForwardedHeader('for=203.0.113.72;proto=https')
// [{ for: '203.0.113.72', proto: 'https', by: null, host: null }]

sttn.parseForwardedHeader('for=[2001:db8::39]')
// null

app.use(sttn.middleware);

The middleware is compatible with Connect (and therefore Express). It adds a forwarded property to the request, with the value of the last forwarded element or { for: null, proto: null, by: null, host: null } if no such object exists or if the header is invalid.

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago