Check if the given request is HTTPS
$ cnpm install is-ssl
Check if the given request is HTTPS
Install package
yarn add is-https # or npm install is-https
Exported function blueprint is isHTTPS (req, xForwardedProto = true): Boolean
.
This function tries to use 3 standard checks for HTTPS detection:
req.connection.encrypted
is true
req.protocol
is https
x-forwarded-proto
header contains https
(Only when xForwardedProto
argument is true
)Return value:
true
null
false
MIT - Nuxt.js
Copyright 2014 - 2016 © taobao.org |