Created
October 4, 2018 03:05
-
-
Save ganeshkbhat/4e0ed36edf448e73afd23840f2d452cd to your computer and use it in GitHub Desktop.
ExpressJS Series: Getting the req.protocol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.post("/someUrl", function(req, res) { | |
| let protocol = req.protocol; | |
| if (protocol !== 'https') { | |
| res.status(426).send("Protocol Insecure"); | |
| } | |
| res.send(200).send({result: 'Success', protocol: protocol}); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment