express-limit-host
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

express limit host

node-test codecov GitHub npm

simple middleware to protect server from host/x-forwarded-host injection.

Usage

just install & use it as an express middleware

const createHostLimit = require("express-limit-host")
const express = require("express")

const app = express()

app.use(createHostLimit({
  loopback: true,
  allowList: [
    'proxy-server-host.com', 
    'direct-service-host.com'
  ],
  rejectStatusCode: 403
}))

// add your router/handler

CHANGELOG

LICENSE

Readme

Keywords

Package Sidebar

Install

npm i express-limit-host

Weekly Downloads

3

Version

0.0.5

License

MIT

Unpacked Size

8.68 kB

Total Files

11

Last publish

Collaborators

  • suntao