0.0.0 • Published 7 years ago
is-ssl v0.0.0
is-https
Check if the given request is HTTPS
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
istrue
- Test if
req.protocol
ishttps
- Test if
x-forwarded-proto
header containshttps
(Only whenxForwardedProto
argument istrue
)
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
0.0.0
7 years ago