0.0.0 • Published 8 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-httpsExported function blueprint is isHTTPS (req, xForwardedProto = true): Boolean.
Behaviour
This function tries to use 3 standard checks for HTTPS detection:
- Test if
req.connection.encryptedistrue - Test if
req.protocolishttps - Test if
x-forwarded-protoheader containshttps(Only whenxForwardedProtoargument 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
8 years ago