JSPM

@firstandthird/hapi-require-https

2.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q83185F
  • License MIT

hapi http -> https redirection

Package Exports

  • @firstandthird/hapi-require-https

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@firstandthird/hapi-require-https) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hapi-require-https Build Status

hapi plugin that adds http to https redirection

By default, any incoming request with 'http' in X-Forwarded-Proto will be redirected (301) to the same host and path with 'https' as the protocol. You can optionally disable proxy mode and redirect based on the actual request protocol.

Usage

Just load the plugin and go!

server.register({
  register: require('hapi-require-https'),
  options: {}
})

API

plugin.register(server, [options], next)

Registers the plugin to run onRequest in the request lifecycle.

options

Type: object
Default: {}

proxy

Type: boolean
Default: true

Indicates whether the server expects requests coming from a reverse proxy (a common Node web server setup) or directly from the Internet. Set this to false if you'd like to redirect based on the actual protocol instead of the X-Forwarded-Proto header.

License

MIT © Ben Drucker