Skip to content

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

License

Notifications You must be signed in to change notification settings

Soontao/express-limit-host

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks