express-force-https-schema

1.0.3 • Public • Published

express-force-https-schema

Installation

$ npm install express-force-https-schema

Description

Very simple configurable express middleware that forces https schema based on x-forwarded-proto header.

The x-forwarded-proto is used by Heroku, AWS ELB and others to tell which schema the request was made with.

Usage

import forceHttpsSchema from "express-force-https-schema";
 
const app = express();
 
app.use(
  forceHttpsSchema({
    enabled: process.env.FORCE_HTTPS === "true",
    skipUserAgents: /ELB-HealthChecker/i
  })
);

Options

Key Default
enabled true
userAgentHeader user-agent
schemaHeader x-forwarded-proto
skipUserAgents null

Test

npm test

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    381
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    381
  • 1.0.2
    1
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i express-force-https-schema

Weekly Downloads

384

Version

1.0.3

License

MIT

Unpacked Size

27 kB

Total Files

16

Last publish

Collaborators

  • kilhage