npm

Need private packages and team management tools?Check out npm Orgs. »

is-https

1.0.0 • Public • Published

is-https

Check if the given request is HTTPS

npm npm (scoped with tag)

Usage

Install package

yarn add is-https # or npm install is-https 

Exported function blueprint is isHTTPS (req, xForwardedProto = true): Boolean.

Behaviour

This function tries to use 3 standard checks for HTTPS detection:

  • Test if req.connection.encrypted is true
  • Test if req.protocol is https
  • Test if x-forwarded-proto header contains https (Only when xForwardedProto argument is true)

Return value:

  • If one of tests is passing, function return true
  • If all tests are unavailable, function returns null
  • Else function returns false

License

MIT - Nuxt.js

Keywords

none

install

npm i is-https

Downloadsweekly downloads

21,428

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability